public void testImplDataSumsTextNodes() throws HtmlMissing { ContentDocument dom = TestEditors.createTestDocument(); c = dom.debugGetRawDocument(); ContentElement root = c.getDocumentElement(); ContentTextNode t1 = c.createTextNode("hello", root, null); Text txt = t1.getImplNodelet(); assertEquals("hello", t1.getImplData()); Text txt3 = Document.get().createTextNode(" there"); txt.getParentNode().insertAfter(txt3, txt); assertEquals("hello there", t1.getImplData()); Text txt2 = txt.splitText(2); assertEquals("hello there", t1.getImplData()); assertSame(txt3, txt.getNextSibling().getNextSibling()); assertTrue(t1.owns(txt) && t1.owns(txt2) && t1.owns(txt3)); ContentTextNode t2 = c.createTextNode("before", root, t1); assertEquals("before", t2.getImplData()); Text t2_2 = t2.getImplNodelet().splitText(3); assertEquals("before", t2.getImplData()); assertTrue(t2.owns(t2_2)); }
public void testImplDataSumsTextNodes() throws HtmlMissing { ContentDocument dom = TestEditors.createTestDocument(); c = dom.debugGetRawDocument(); ContentElement root = c.getDocumentElement(); ContentTextNode t1 = c.createTextNode("hello", root, null); Text txt = t1.getImplNodelet(); assertEquals("hello", t1.getImplData()); Text txt3 = Document.get().createTextNode(" there"); txt.getParentNode().insertAfter(txt3, txt); assertEquals("hello there", t1.getImplData()); Text txt2 = txt.splitText(2); assertEquals("hello there", t1.getImplData()); assertSame(txt3, txt.getNextSibling().getNextSibling()); assertTrue(t1.owns(txt) && t1.owns(txt2) && t1.owns(txt3)); ContentTextNode t2 = c.createTextNode("before", root, t1); assertEquals("before", t2.getImplData()); Text t2_2 = t2.getImplNodelet().splitText(3); assertEquals("before", t2.getImplData()); assertTrue(t2.owns(t2_2)); }