Auto merge of #8506 - nox:finish-ranges, r=dzbarsky

Properly propagate changes when range or trees are mutated

Does the same thing as #6817, but storing Range instances directly in their start and end containers.

Cc @dzbarsky

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8506)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-12-26 04:08:15 +05:30
commit 89ab368258
20 changed files with 669 additions and 4708 deletions

View file

@ -38,10 +38,10 @@ macro_rules! sizeof_checker (
// Update the sizes here
sizeof_checker!(size_event_target, EventTarget, 40);
sizeof_checker!(size_node, Node, 160);
sizeof_checker!(size_element, Element, 304);
sizeof_checker!(size_htmlelement, HTMLElement, 320);
sizeof_checker!(size_div, HTMLDivElement, 320);
sizeof_checker!(size_span, HTMLSpanElement, 320);
sizeof_checker!(size_text, Text, 192);
sizeof_checker!(size_characterdata, CharacterData, 192);
sizeof_checker!(size_node, Node, 184);
sizeof_checker!(size_element, Element, 328);
sizeof_checker!(size_htmlelement, HTMLElement, 344);
sizeof_checker!(size_div, HTMLDivElement, 344);
sizeof_checker!(size_span, HTMLSpanElement, 344);
sizeof_checker!(size_text, Text, 216);
sizeof_checker!(size_characterdata, CharacterData, 216);

View file

@ -1,23 +1,5 @@
[Range-deleteContents.html]
type: testharness
[Resulting cursor position for range 1 [paras[0\].firstChild, 0, paras[0\].firstChild, 1\]]
expected: FAIL
[Resulting cursor position for range 2 [paras[0\].firstChild, 2, paras[0\].firstChild, 8\]]
expected: FAIL
[Resulting cursor position for range 3 [paras[0\].firstChild, 2, paras[0\].firstChild, 9\]]
expected: FAIL
[Resulting cursor position for range 5 [paras[1\].firstChild, 2, paras[1\].firstChild, 9\]]
expected: FAIL
[Resulting cursor position for range 7 [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\]]
expected: FAIL
[Resulting cursor position for range 9 [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\]]
expected: FAIL
[Resulting cursor position for range 18 [paras[0\].firstChild, 0, paras[1\].firstChild, 0\]]
expected: FAIL
@ -30,27 +12,6 @@
[Resulting DOM for range 24 [document, 0, document, 2\]]
expected: FAIL
[Resulting cursor position for range 25 [comment, 2, comment, 3\]]
expected: FAIL
[Resulting cursor position for range 30 [detachedTextNode, 0, detachedTextNode, 8\]]
expected: FAIL
[Resulting cursor position for range 31 [detachedForeignTextNode, 0, detachedForeignTextNode, 8\]]
expected: FAIL
[Resulting cursor position for range 32 [detachedXmlTextNode, 0, detachedXmlTextNode, 8\]]
expected: FAIL
[Resulting cursor position for range 33 [detachedComment, 3, detachedComment, 4\]]
expected: FAIL
[Resulting cursor position for range 34 [detachedForeignComment, 0, detachedForeignComment, 1\]]
expected: FAIL
[Resulting cursor position for range 35 [detachedXmlComment, 2, detachedXmlComment, 6\]]
expected: FAIL
[Resulting DOM for range 10 [document.documentElement, 0, document.documentElement, 1\]]
expected: FAIL
@ -66,21 +27,6 @@
[Resulting DOM for range 27 [foreignDoc, 1, foreignComment, 2\]]
expected: FAIL
[Resulting cursor position for range 37 [processingInstruction, 0, processingInstruction, 4\]]
expected: FAIL
[Resulting cursor position for range 38 [paras[1\].firstChild, 0, paras[1\].firstChild, 1\]]
expected: FAIL
[Resulting cursor position for range 39 [paras[1\].firstChild, 2, paras[1\].firstChild, 8\]]
expected: FAIL
[Resulting cursor position for range 40 [detachedPara1.firstChild, 0, detachedPara1.firstChild, 1\]]
expected: FAIL
[Resulting cursor position for range 41 [foreignPara1.firstChild, 0, foreignPara1.firstChild, 1\]]
expected: FAIL
[Resulting DOM for range 49 [document, 1, document, 2\]]
expected: FAIL

View file

@ -1,23 +1,5 @@
[Range-extractContents.html]
type: testharness
[Resulting cursor position for range 1 [paras[0\].firstChild, 0, paras[0\].firstChild, 1\]]
expected: FAIL
[Resulting cursor position for range 2 [paras[0\].firstChild, 2, paras[0\].firstChild, 8\]]
expected: FAIL
[Resulting cursor position for range 3 [paras[0\].firstChild, 2, paras[0\].firstChild, 9\]]
expected: FAIL
[Resulting cursor position for range 5 [paras[1\].firstChild, 2, paras[1\].firstChild, 9\]]
expected: FAIL
[Resulting cursor position for range 7 [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\]]
expected: FAIL
[Resulting cursor position for range 9 [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\]]
expected: FAIL
[Resulting cursor position for range 18 [paras[0\].firstChild, 0, paras[1\].firstChild, 0\]]
expected: FAIL
@ -27,42 +9,6 @@
[Resulting cursor position for range 20 [paras[0\].firstChild, 3, paras[3\], 1\]]
expected: FAIL
[Resulting cursor position for range 25 [comment, 2, comment, 3\]]
expected: FAIL
[Resulting cursor position for range 30 [detachedTextNode, 0, detachedTextNode, 8\]]
expected: FAIL
[Resulting cursor position for range 31 [detachedForeignTextNode, 0, detachedForeignTextNode, 8\]]
expected: FAIL
[Resulting cursor position for range 32 [detachedXmlTextNode, 0, detachedXmlTextNode, 8\]]
expected: FAIL
[Resulting cursor position for range 33 [detachedComment, 3, detachedComment, 4\]]
expected: FAIL
[Resulting cursor position for range 34 [detachedForeignComment, 0, detachedForeignComment, 1\]]
expected: FAIL
[Resulting cursor position for range 35 [detachedXmlComment, 2, detachedXmlComment, 6\]]
expected: FAIL
[Resulting cursor position for range 37 [processingInstruction, 0, processingInstruction, 4\]]
expected: FAIL
[Resulting cursor position for range 38 [paras[1\].firstChild, 0, paras[1\].firstChild, 1\]]
expected: FAIL
[Resulting cursor position for range 39 [paras[1\].firstChild, 2, paras[1\].firstChild, 8\]]
expected: FAIL
[Resulting cursor position for range 40 [detachedPara1.firstChild, 0, detachedPara1.firstChild, 1\]]
expected: FAIL
[Resulting cursor position for range 41 [foreignPara1.firstChild, 0, foreignPara1.firstChild, 1\]]
expected: FAIL
[Resulting cursor position for range 50 [paras[2\].firstChild, 4, comment, 2\]]
expected: FAIL

File diff suppressed because it is too large Load diff