Changeset 155253 in webkit
- Timestamp:
- Sep 7, 2013, 11:25:46 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 68 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r155252 r155253 1 2013-09-07 Antti Koivisto <antti@apple.com> 2 3 Remove unnecessary sibling text renderers after attach 4 https://bugs.webkit.org/show_bug.cgi?id=120953 5 6 Reviewed by Anders Carlsson and Andreas Kling. 7 8 A bunch of spaces and empty lines disappear from dumpAsText test results. 9 Empty RenderTexts disapper from render tree dumps. 10 11 * css3/flexbox/flex-flow-auto-margins-expected.txt: 12 * css3/flexbox/flex-flow-auto-margins-no-available-space-expected.txt: 13 * css3/flexbox/flex-flow-border-expected.txt: 14 * css3/flexbox/flex-flow-margins-auto-size-expected.txt: 15 * css3/flexbox/flex-flow-margins-expected.txt: 16 * css3/flexbox/flex-flow-orientations-expected.txt: 17 * css3/flexbox/flex-flow-overflow-expected.txt: 18 * css3/flexbox/flex-flow-padding-expected.txt: 19 * css3/flexbox/flexbox-ignore-firstLetter-expected.txt: 20 * css3/flexbox/inline-flexbox-ignore-firstLine-expected.txt: 21 * css3/flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt: 22 * editing/selection/focus-crash-expected.txt: 23 24 A few frame based tests also gain an extra space from alrgorithm fixes in creation direction. 25 26 * editing/style/toggle-style-bold-italic-expected.txt: 27 * editing/style/toggle-style-bold-italic-mixed-editability-expected.txt: 28 * fast/block/float/intruding-float-not-removed-writing-mode-expected.txt: 29 * fast/css/getComputedStyle/getComputedStyle-resolved-values-expected.txt: 30 * fast/css/import-style-update-expected.txt: 31 * fast/css/positioned-overflow-scroll-expected.txt: 32 * fast/dom/HTMLLinkElement/resolve-url-on-insertion-expected.txt: 33 * fast/dom/search-shadow-host-crash-expected.txt: 34 * fast/dynamic/inline-to-block-crash-expected.txt: 35 * fast/events/input-element-display-none-in-dragleave-crash-expected.txt: 36 * fast/flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt: 37 * fast/forms/select-listbox-focus-displaynone-expected.txt: 38 * fast/frames/repaint-display-none-crash-expected.txt: 39 * fast/inline/inline-with-empty-inline-children-expected.txt: 40 * fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline-expected.txt: 41 * fast/repaint/text-in-relative-positioned-inline-expected.txt: 42 * fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-expected.txt: 43 * fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr-expected.txt: 44 * fast/replaced/preferred-widths-expected.txt: 45 * fast/spatial-navigation/snav-tiny-table-traversal-expected.txt: 46 * fast/table/min-max-width-preferred-size-expected.txt: 47 * fast/xsl/import-non-document-node-expected.txt: 48 * fullscreen/full-screen-fixed-pos-parent-expected.txt: 49 * http/tests/appcache/auth-expected.txt: 50 * http/tests/cache/subresource-expiration-1-expected.txt: 51 * http/tests/cache/subresource-expiration-2-expected.txt: 52 * http/tests/xmlhttprequest/send-array-buffer-expected.txt: 53 * http/tests/xmlhttprequest/send-data-view-expected.txt: 54 * http/tests/xmlhttprequest/send-undefined-and-null-expected.txt: 55 * platform/mac/editing/input/firstrectforcharacterrange-plain-expected.txt: 56 * platform/mac/editing/input/firstrectforcharacterrange-styled-expected.txt: 57 * platform/mac/editing/pasteboard/4989774-expected.txt: 58 * platform/mac/editing/pasteboard/paste-match-style-001-expected.txt: 59 * platform/mac/editing/selection/caret-ltr-2-expected.txt: 60 * platform/mac/editing/selection/caret-ltr-2-left-expected.txt: 61 * platform/mac/editing/selection/caret-ltr-expected.txt: 62 * platform/mac/editing/selection/caret-ltr-right-expected.txt: 63 * platform/mac/editing/selection/caret-rtl-2-expected.txt: 64 * platform/mac/editing/selection/caret-rtl-2-left-expected.txt: 65 * platform/mac/editing/selection/caret-rtl-expected.txt: 66 * platform/mac/editing/selection/caret-rtl-right-expected.txt: 67 * platform/mac/editing/selection/vertical-rl-ltr-extend-line-backward-wrap-expected.txt: 68 * platform/mac/editing/selection/vertical-rl-ltr-extend-line-forward-wrap-expected.txt: 69 * platform/mac/editing/spelling/autocorrection-in-textarea-expected.txt: 70 * platform/mac/editing/style/style-boundary-005-expected.txt: 71 * platform/mac/fast/AppleScript/001-expected.txt: 72 * platform/mac/fast/AppleScript/date-expected.txt: 73 * platform/mac/fast/forms/formmove3-expected.txt: 74 * platform/mac/fast/forms/input-align-image-expected.txt: 75 * platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt: 76 * platform/mac/fast/invalid/003-expected.txt: 77 * platform/mac/fast/text/attributed-substring-from-range-002-expected.txt: 78 * platform/mac/tables/mozilla/bugs/bug647-expected.txt: 79 * userscripts/user-script-all-frames-expected.txt: 80 * userscripts/user-script-top-frame-only-expected.txt: 81 82 Here too. 83 1 84 2013-09-07 Mark Lam <mark.lam@apple.com> 2 85 -
trunk/LayoutTests/css3/flexbox/flex-flow-auto-margins-expected.txt
r117897 r155253 127 127 vertical-rl rtl row-reverse logical 128 128 PASS 129 -
trunk/LayoutTests/css3/flexbox/flex-flow-auto-margins-no-available-space-expected.txt
r136660 r155253 1 1 PASS 2 PASS 3 PASS 4 PASS 5 2 PASS 3 PASS 4 PASS -
trunk/LayoutTests/css3/flexbox/flex-flow-border-expected.txt
r101897 r155253 127 127 vertical-rl ltr column-reverse logical 128 128 PASS 129 -
trunk/LayoutTests/css3/flexbox/flex-flow-margins-auto-size-expected.txt
r113097 r155253 143 143 <div style="-webkit-flex: 1 auto; width: 20px; height: 20px;" data-expected-width="20" data-expected-height="20" data-offset-x="48" data-offset-y="23"></div> 144 144 </div></div> 145 -
trunk/LayoutTests/css3/flexbox/flex-flow-margins-expected.txt
r101897 r155253 127 127 vertical-rl ltr row-reverse logical 128 128 PASS 129 -
trunk/LayoutTests/css3/flexbox/flex-flow-orientations-expected.txt
r101897 r155253 63 63 vertical-rl ltr column-reverse 64 64 PASS 65 -
trunk/LayoutTests/css3/flexbox/flex-flow-overflow-expected.txt
r101897 r155253 63 63 vertical-rl ltr column-reverse 64 64 PASS 65 -
trunk/LayoutTests/css3/flexbox/flex-flow-padding-expected.txt
r101897 r155253 127 127 vertical-rl ltr column-reverse logical 128 128 PASS 129 -
trunk/LayoutTests/css3/flexbox/flexbox-ignore-firstLetter-expected.txt
r143993 r155253 11 11 12 12 PASS 13 -
trunk/LayoutTests/css3/flexbox/inline-flexbox-ignore-firstLine-expected.txt
r143042 r155253 6 6 7 7 PASS 8 -
trunk/LayoutTests/css3/flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt
r139535 r155253 5 5 PASS 6 6 PASS 7 PASS 8 7 PASS -
trunk/LayoutTests/editing/selection/focus-crash-expected.txt
r69051 r155253 1 To run this test manually, click the "Crash me" button. 1 To run this test manually, click the "Crash me" button. 2 2 SUCCEEDED -
trunk/LayoutTests/editing/style/toggle-style-bold-italic-expected.txt
r153509 r155253 69 69 execBoldCommand: <div id="test"> <div><i>Some text</i></div> <p><i>Some more text</i></p> </div> 70 70 execItalicCommand: <div id="test"> <div>Some text</div> <p>Some more text</p> </div> 71 -
trunk/LayoutTests/editing/style/toggle-style-bold-italic-mixed-editability-expected.txt
r153509 r155253 67 67 execBoldCommand: <div id="test"><i> Editable </i><span contenteditable="false">Non-editable</span><i> Editable </i></div> 68 68 execItalicCommand: <div id="test"> Editable <span contenteditable="false">Non-editable</span> Editable </div> 69 -
trunk/LayoutTests/fast/block/float/intruding-float-not-removed-writing-mode-expected.txt
r136253 r155253 1 1 Test passes if it does not crash. 2 2 -
trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-resolved-values-expected.txt
r102149 r155253 272 272 Auto 273 273 Mixed 274 -
trunk/LayoutTests/fast/css/import-style-update-expected.txt
r30635 r155253 1 1 Test that modifying @import stylesheet through DOM updates style properly. You should see PASS below: 2 2 PASS 3 -
trunk/LayoutTests/fast/css/positioned-overflow-scroll-expected.txt
r139344 r155253 1 1 Test that scrollbar width is added to the intrinsic width of different display types. 2 2 PASS 3 -
trunk/LayoutTests/fast/dom/HTMLLinkElement/resolve-url-on-insertion-expected.txt
r147291 r155253 4 4 5 5 I should be red...and I am!!! 6 7 -
trunk/LayoutTests/fast/dom/search-shadow-host-crash-expected.txt
r76366 r155253 1 1 Click on the search box. This test passes if does not crash. 2 3 -
trunk/LayoutTests/fast/dynamic/inline-to-block-crash-expected.txt
r24887 r155253 1 1 PASSED 2 -
trunk/LayoutTests/fast/events/input-element-display-none-in-dragleave-crash-expected.txt
r110226 r155253 1 1 This test passes if there is no crash when dragging a file over and then away from the file input element below. 2 3 -
trunk/LayoutTests/fast/flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt
r139535 r155253 6 6 PASS 7 7 PASS 8 -
trunk/LayoutTests/fast/forms/select-listbox-focus-displaynone-expected.txt
r69827 r155253 1 1 PASS -
trunk/LayoutTests/fast/frames/repaint-display-none-crash-expected.txt
r48891 r155253 2 2 3 3 No crash means test PASS. 4 5 -
trunk/LayoutTests/fast/inline/inline-with-empty-inline-children-expected.txt
r147939 r155253 2 2 3 3 PASS 4 PASS 5 PASS 4 6 PASS 7 PASS 5 8 PASS 6 PASS7 PASS8 PASS9 -
trunk/LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline-expected.txt
r148223 r155253 17 17 Input 18 18 PASS 19 -
trunk/LayoutTests/fast/repaint/text-in-relative-positioned-inline-expected.txt
r84166 r155253 5 5 RenderBody {BODY} at (8,8) size 784x584 6 6 RenderBlock {DIV} at (100,0) size 684x100 7 RenderText {#text} at (0,0) size 0x08 7 RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000] -
trunk/LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-expected.txt
r143102 r155253 4 4 5 5 PASS 6 -
trunk/LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr-expected.txt
r143102 r155253 4 4 5 5 PASS 6 -
trunk/LayoutTests/fast/replaced/preferred-widths-expected.txt
r142931 r155253 3 3 4 4 PASS 5 5 6 6 PASS 7 7 8 8 FAIL: 9 9 Expected 130 for width, but got 30. … … 12 12 <img class="min-content" src="resources/square-blue-100x100.png" style="width: 100%; border: 5px solid black; padding: 5px;" data-expected-width="120" data-expected-height="120"> 13 13 </div> 14 14 15 15 FAIL: 16 16 Expected 130 for width, but got 30. … … 19 19 <img class="max-content" src="resources/square-blue-100x100.png" style="width: 100%; border: 5px solid black; padding: 5px;" data-expected-width="120" data-expected-height="120"> 20 20 </div> 21 22 PASS 23 24 PASS 25 26 PASS 27 28 PASS 29 21 30 22 PASS 31 23 24 PASS 25 26 PASS 27 28 PASS 29 30 PASS -
trunk/LayoutTests/fast/spatial-navigation/snav-tiny-table-traversal-expected.txt
r97881 r155253 5 5 a 6 6 a 7 7 PASS gFocusedDocument.activeElement.getAttribute("id") is "1" 8 8 PASS gFocusedDocument.activeElement.getAttribute("id") is "4" 9 9 PASS gFocusedDocument.activeElement.getAttribute("id") is "7" -
trunk/LayoutTests/fast/table/min-max-width-preferred-size-expected.txt
r140479 r155253 3 3 4 4 PASS 5 -
trunk/LayoutTests/fast/xsl/import-non-document-node-expected.txt
r106043 r155253 2 2 3 3 SUCCESS 4 5 -
trunk/LayoutTests/fullscreen/full-screen-fixed-pos-parent-expected.txt
r145296 r155253 1 1 2 -
trunk/LayoutTests/http/tests/appcache/auth-expected.txt
r47439 r155253 2 2 3 3 SUCCESS 4 5 -
trunk/LayoutTests/http/tests/cache/subresource-expiration-1-expected.txt
r106043 r155253 10 10 Cache-control: max-age=1; [delay=1.5s] (result=Uncached expected=Uncached) PASS 11 11 Cache-control: max-age=10, no-cache; (result=Uncached expected=Uncached) PASS 12 -
trunk/LayoutTests/http/tests/cache/subresource-expiration-2-expected.txt
r114165 r155253 12 12 Last-modified: [now-10s]; [delay=1.5s] (result=Uncached expected=Uncached) PASS 13 13 Last-modified: [now+10s]; (result=Uncached expected=Uncached) PASS 14 -
trunk/LayoutTests/http/tests/xmlhttprequest/send-array-buffer-expected.txt
r122074 r155253 1 1 Tests sending an array buffer view. 2 2 0 1 2 48 49 50 128 129 130 253 254 255 3 -
trunk/LayoutTests/http/tests/xmlhttprequest/send-data-view-expected.txt
r122074 r155253 1 1 Tests sending a data view. 2 2 0 1 2 48 49 50 128 129 130 253 254 255 3 -
trunk/LayoutTests/http/tests/xmlhttprequest/send-undefined-and-null-expected.txt
r106043 r155253 2 2 PASS for undefined 3 3 PASS for null 4 -
trunk/LayoutTests/platform/mac/editing/input/firstrectforcharacterrange-plain-expected.txt
r112556 r155253 19 19 0,0,0,0 20 20 0,0,0,0 21 22 -
trunk/LayoutTests/platform/mac/editing/input/firstrectforcharacterrange-styled-expected.txt
r112556 r155253 23 23 0,0,0,0 24 24 0,0,0,0 25 26 -
trunk/LayoutTests/platform/mac/editing/pasteboard/4989774-expected.txt
r63291 r155253 13 13 text run at (782,103) width 2: " " 14 14 text run at (0,121) width 307: "pictures above all in the same line/paragraph." 15 RenderText {#text} at (0,0) size 0x016 RenderText {#text} at (0,0) size 0x017 15 caret: position 164 of child 4 {#text} of body -
trunk/LayoutTests/platform/mac/editing/pasteboard/paste-match-style-001-expected.txt
r130411 r155253 45 45 text run at (2,2) width 25: "ab" 46 46 RenderBlock (anonymous) at (0,32) size 784x0 47 RenderText {#text} at (0,0) size 0x048 47 caret: position 2 of child 0 {#text} of child 0 {B} of child 1 {DIV} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/selection/caret-ltr-2-expected.txt
r149210 r155253 15 15 text run at (0,0) width 39: "PASS" 16 16 RenderBR {BR} at (39,0) size 0x18 17 RenderText {#text} at (0,0) size 0x018 17 caret: position 0 of child 0 {#text} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/selection/caret-ltr-2-left-expected.txt
r149210 r155253 15 15 text run at (0,0) width 39: "PASS" 16 16 RenderBR {BR} at (39,0) size 0x18 17 RenderText {#text} at (0,0) size 0x018 17 caret: position 7 of child 0 {#text} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/selection/caret-ltr-expected.txt
r149210 r155253 15 15 text run at (0,0) width 39: "PASS" 16 16 RenderBR {BR} at (39,0) size 0x18 17 RenderText {#text} at (0,0) size 0x018 17 caret: position 0 of child 0 {#text} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/selection/caret-ltr-right-expected.txt
r149210 r155253 15 15 text run at (0,0) width 39: "PASS" 16 16 RenderBR {BR} at (39,0) size 0x18 17 RenderText {#text} at (0,0) size 0x018 17 caret: position 7 of child 0 {#text} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/selection/caret-rtl-2-expected.txt
r149210 r155253 15 15 text run at (0,0) width 39: "PASS" 16 16 RenderBR {BR} at (39,0) size 0x18 17 RenderText {#text} at (0,0) size 0x018 17 caret: position 7 of child 0 {#text} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/selection/caret-rtl-2-left-expected.txt
r149210 r155253 15 15 text run at (0,0) width 39: "PASS" 16 16 RenderBR {BR} at (39,0) size 0x18 17 RenderText {#text} at (0,0) size 0x018 17 caret: position 0 of child 0 {#text} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/selection/caret-rtl-expected.txt
r149210 r155253 15 15 text run at (0,0) width 39: "PASS" 16 16 RenderBR {BR} at (39,0) size 0x18 17 RenderText {#text} at (0,0) size 0x018 17 caret: position 7 of child 0 {#text} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/selection/caret-rtl-right-expected.txt
r149210 r155253 15 15 text run at (0,0) width 39: "PASS" 16 16 RenderBR {BR} at (39,0) size 0x18 17 RenderText {#text} at (0,0) size 0x018 17 caret: position 0 of child 0 {#text} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/selection/vertical-rl-ltr-extend-line-backward-wrap-expected.txt
r126183 r155253 13 13 text run at (27,0) width 128: "\x{540D}\x{524D}\x{306F}\x{307E}\x{3060}\x{7121}\x{3044}\x{3002}" 14 14 RenderBlock (anonymous) at (0,170) size 784x0 15 RenderText {#text} at (0,0) size 0x016 15 RenderBlock {PRE} at (0,183) size 784x0 17 16 selection start: position 5 of child 0 {#text} of child 1 {P} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/selection/vertical-rl-ltr-extend-line-forward-wrap-expected.txt
r126183 r155253 13 13 text run at (27,0) width 128: "\x{540D}\x{524D}\x{306F}\x{307E}\x{3060}\x{7121}\x{3044}\x{3002}" 14 14 RenderBlock (anonymous) at (0,170) size 784x0 15 RenderText {#text} at (0,0) size 0x016 15 RenderBlock {PRE} at (0,183) size 784x0 17 16 selection start: position 2 of child 0 {#text} of child 1 {P} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/style/style-boundary-005-expected.txt
r96264 r155253 66 66 text run at (121,2) width 23: "one" 67 67 RenderBlock (anonymous) at (0,22) size 784x0 68 RenderText {#text} at (0,0) size 0x069 68 caret: position 3 of child 2 {#text} of child 1 {DIV} of child 3 {DIV} of body -
trunk/LayoutTests/platform/mac/fast/AppleScript/001-expected.txt
r147872 r155253 18 18 (null) 19 19 "[object Object]" ('utxt') 20 21 -
trunk/LayoutTests/platform/mac/fast/forms/formmove3-expected.txt
r149210 r155253 27 27 RenderText {#text} at (0,0) size 0x0 28 28 RenderBlock (anonymous) at (0,28) size 784x18 29 RenderText {#text} at (0,0) size 0x030 29 RenderText {#text} at (0,0) size 104x18 31 30 text run at (0,0) width 104: "Form did submit" -
trunk/LayoutTests/platform/mac/fast/forms/input-align-image-expected.txt
r32872 r155253 15 15 RenderBR {BR} at (0,54) size 0x18 16 16 RenderImage {INPUT} at (767,72) size 17x19 17 RenderText {#text} at (0,0) size 0x018 17 RenderBR {BR} at (0,72) size 0x18 19 18 RenderBR {BR} at (0,90) size 0x18 -
trunk/LayoutTests/platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt
r149210 r155253 24 24 RenderText {#text} at (0,0) size 0x0 25 25 RenderBlock (anonymous) at (0,25) size 784x0 26 RenderText {#text} at (0,0) size 0x027 26 RenderBlock {DIV} at (0,25) size 784x36 28 27 RenderText {#text} at (0,0) size 775x36 -
trunk/LayoutTests/platform/mac/fast/invalid/003-expected.txt
r120477 r155253 50 50 text run at (123,0) width 126: " I should not be red." 51 51 RenderBlock (anonymous) at (0,170) size 784x18 52 RenderText {#text} at (0,0) size 0x053 52 RenderInline {B} at (0,0) size 131x18 54 53 RenderText {#text} at (0,0) size 36x18 -
trunk/LayoutTests/platform/mac/fast/text/attributed-substring-from-range-002-expected.txt
r112556 r155253 7 7 from attributedSubstringFromRange: 123456789 8 8 SUCCESS: Strings matched, although there is room for improvement because they were both wrong. 9 -
trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug647-expected.txt
r120477 r155253 26 26 RenderText {#text} at (0,0) size 0x0 27 27 RenderBlock (anonymous) at (2,15) size 90x0 28 RenderText {#text} at (0,0) size 0x029 28 RenderBlock (anonymous) at (0,23) size 100x18 30 29 RenderText {#text} at (10,0) size 80x18 -
trunk/LayoutTests/userscripts/user-script-all-frames-expected.txt
r62876 r155253 1 If any thingers appear on this page, the test has failed. 1 If any thingers appear on this page, the test has failed. 2 2 3 3 -------- -
trunk/LayoutTests/userscripts/user-script-top-frame-only-expected.txt
r62876 r155253 1 Two thingers should appear on this page. Otherwise the test has failed. 1 Two thingers should appear on this page. Otherwise the test has failed. 2 2 3 3 -------- -
trunk/Source/WebCore/ChangeLog
r155251 r155253 1 2013-09-07 Antti Koivisto <antti@apple.com> 2 3 Remove unnecessary sibling text renderers after attach 4 https://bugs.webkit.org/show_bug.cgi?id=120953 5 6 Reviewed by the Swedish Review Team: Anders Carlsson and Andreas Kling. 7 8 The current createTextRenderersForSiblingsAfterAttachIfNeeded code only adds text renderers, never removes them. 9 Style changes can go either way. 10 11 The patch causes no visible changes in rendered output. The whitespace nodes that it affects are leftovers that 12 have no rendering effect. However it does change results of many dumpAsText and render tree dump based layout 13 tests as unnecessary text nodes disappear. 14 15 The main goal is to make results of dynamic attach and parsing time attach produce more similar results. As 16 an added bonus we get slightly simpler rendering trees. 17 18 Rendering tree dumps show us still leaving behind empty anonymous blocks when removing whitespace text nodes. 19 Those should collapse away too. 20 21 * style/StyleResolveTree.cpp: 22 (WebCore::Style::reattachTextRenderersForWhitespaceOnlySiblingsAfterAttachIfNeeded): 23 24 Allow the code both create and remove text renderers. 25 Tighten to bail out faster if case is not the exact one that matters. 26 Use NodeRenderingTraversal to mirror textRendererIsNeeded. 27 Renamed for clarity. 28 29 (WebCore::Style::updateTextRendererAfterContentChange): 30 (WebCore::Style::resolveLocal): 31 (WebCore::Style::updateTextStyle): 32 (WebCore::Style::attachRenderTree): 33 1 34 2013-09-07 Anders Carlsson <andersca@apple.com> 2 35 -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r155116 r155253 281 281 } 282 282 283 static void createTextRenderersForSiblingsAfterAttachIfNeeded(Node& node) 284 { 285 if (!node.renderer()) 286 return; 287 // If this node got a renderer it may be the previousRenderer() of sibling text nodes and thus affect the 288 // result of Text::textRendererIsNeeded() for those nodes. 289 for (Node* sibling = node.nextSibling(); sibling; sibling = sibling->nextSibling()) { 290 if (sibling->renderer()) 291 break; 283 static void reattachTextRenderersForWhitespaceOnlySiblingsAfterAttachIfNeeded(Node& current) 284 { 285 if (current.isInsertionPoint()) 286 return; 287 // This function finds sibling text renderers where the results of textRendererIsNeeded may have changed as a result of 288 // the current node gaining or losing the renderer. This can only affect white space text nodes. 289 for (Node* sibling = NodeRenderingTraversal::nextSibling(¤t); sibling; sibling = NodeRenderingTraversal::nextSibling(sibling)) { 290 // Siblings haven't been attached yet. They will be handled normally when they are. 292 291 if (!sibling->attached()) 293 break; // Assume this means none of the following siblings are attached. 292 return; 293 if (sibling->isElementNode()) { 294 // Text renderers beyond rendered elements can't be affected. 295 if (!sibling->renderer() || isRendererReparented(sibling->renderer())) 296 continue; 297 return; 298 } 294 299 if (!sibling->isTextNode()) 295 300 continue; 296 attachTextRenderer(*toText(sibling)); 297 // If we again decided not to create a renderer for next, we can bail out the loop, 298 // because it won't affect the result of Text::textRendererIsNeeded() for the rest 299 // of sibling nodes. 300 if (!sibling->renderer()) 301 break; 301 Text& textSibling = *toText(sibling); 302 if (!textSibling.length() || !textSibling.containsOnlyWhitespace()) 303 return; 304 Text& whitespaceTextSibling = textSibling; 305 bool hadRenderer = whitespaceTextSibling.renderer(); 306 detachTextRenderer(whitespaceTextSibling); 307 attachTextRenderer(whitespaceTextSibling); 308 // No changes, futher renderers can't be affected. 309 if (hadRenderer == !!whitespaceTextSibling.renderer()) 310 return; 302 311 } 303 312 } … … 408 417 if (!textRenderer) { 409 418 attachTextRenderer(textNode); 410 createTextRenderersForSiblingsAfterAttachIfNeeded(textNode);419 reattachTextRenderersForWhitespaceOnlySiblingsAfterAttachIfNeeded(textNode); 411 420 return; 412 421 } … … 415 424 detachTextRenderer(textNode); 416 425 attachTextRenderer(textNode); 426 reattachTextRenderersForWhitespaceOnlySiblingsAfterAttachIfNeeded(textNode); 417 427 return; 418 428 } … … 590 600 detachRenderTree(current, ReattachDetach); 591 601 attachRenderTree(current, newStyle.get()); 592 createTextRenderersForSiblingsAfterAttachIfNeeded(current);602 reattachTextRenderersForWhitespaceOnlySiblingsAfterAttachIfNeeded(current); 593 603 594 604 return Detach; … … 634 644 else { 635 645 attachTextRenderer(text); 636 createTextRenderersForSiblingsAfterAttachIfNeeded(text);646 reattachTextRenderersForWhitespaceOnlySiblingsAfterAttachIfNeeded(text); 637 647 } 638 648 text.clearNeedsStyleRecalc(); … … 818 828 { 819 829 attachRenderTree(element, nullptr); 820 createTextRenderersForSiblingsAfterAttachIfNeeded(element);830 reattachTextRenderersForWhitespaceOnlySiblingsAfterAttachIfNeeded(element); 821 831 } 822 832
Note:
See TracChangeset
for help on using the changeset viewer.