Changeset 172494 in webkit
- Timestamp:
- Aug 12, 2014 2:31:23 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r172472 r172494 1 2014-08-12 Antti Koivisto <antti@apple.com> 2 3 Don't recurse into non-rendered subtrees when computing style 4 https://bugs.webkit.org/show_bug.cgi?id=135844 5 6 Reviewed by Andreas Kling. 7 8 Rebase. 9 10 * http/tests/security/video-poster-cross-origin-crash-expected.txt: 11 * platform/mac/fast/ruby/ruby-base-merge-block-children-crash-2-expected.txt: 12 1 13 2014-08-12 Fabien Vallée <fvallee@connected-labs.com> 2 14 -
trunk/LayoutTests/http/tests/security/video-poster-cross-origin-crash-expected.txt
r123121 r172494 1 CONSOLE MESSAGE: Cross-origin image load denied by Cross-Origin Resource Sharing policy.2 1 CONSOLE MESSAGE: Cross-origin image load denied by Cross-Origin Resource Sharing policy. 3 2 >>> -
trunk/LayoutTests/platform/mac/fast/ruby/ruby-base-merge-block-children-crash-2-expected.txt
r164375 r172494 5 5 RenderBody {BODY} at (8,8) size 784x584 6 6 RenderBlock {SUMMARY} at (0,0) size 784x184 7 RenderInline {I} at (0,0) size 304x187 RenderInline {I} at (0,0) size 604x18 8 8 RenderRuby (inline) {RUBY} at (0,0) size 300x18 9 9 RenderRubyRun (anonymous) at (0,171) size 0x0 … … 21 21 RenderText {#text} at (300,157) size 4x18 22 22 text run at (300,157) width 4: " " 23 RenderEmbeddedObject {OBJECT} at (304,21) size 300x15023 RenderEmbeddedObject {OBJECT} at (304,21) size 300x150 24 24 RenderText {#text} at (0,0) size 0x0 25 25 RenderBlock {DIV} at (0,184) size 784x18 … … 30 30 text run at (138,0) width 455: ". This test must be run under Guard Malloc. It passes if it does not crash." 31 31 selection start: position 0 of child 1 {OBJECT} of child 3 {H1} of child 0 {RUBY} of child 1 {I} of child 0 {SUMMARY} of body 32 selection end: position 0 of child 3 {#text} of child 0 {SUMMARY} of body32 selection end: position 1 of child 2 {OBJECT} of child 1 {I} of child 0 {SUMMARY} of body -
trunk/Source/WebCore/ChangeLog
r172487 r172494 1 2014-08-12 Antti Koivisto <antti@apple.com> 2 3 Don't recurse into non-rendered subtrees when computing style 4 https://bugs.webkit.org/show_bug.cgi?id=135844 5 6 Reviewed by Andreas Kling. 7 8 * style/StyleResolveTree.cpp: 9 (WebCore::Style::resetStyleForNonRenderedDescendants): 10 11 Do a simple reset of the style dirty bits and any computed style in non-rendered subtrees. 12 13 (WebCore::Style::attachRenderTree): 14 (WebCore::Style::resolveTree): 15 16 Don't recurse into descendants if the element does not create a renderer. 17 We didn't compute style anyway in such subtrees. 18 1 19 2014-08-12 Antti Koivisto <antti@apple.com> 2 20 -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r172487 r172494 556 556 } 557 557 558 static void resetStyleForNonRenderedDescendants(Element& current) 559 { 560 ASSERT(!current.renderStyle()); 561 auto descendants = descendantsOfType<Element>(current); 562 auto it = descendants.begin(); 563 auto end = descendants.end(); 564 while (it != end) { 565 auto& element = *it; 566 ASSERT(!element.renderStyle()); 567 if (element.needsStyleRecalc()) { 568 element.resetComputedStyle(); 569 element.clearNeedsStyleRecalc(); 570 } 571 if (element.childNeedsStyleRecalc()) { 572 element.clearChildNeedsStyleRecalc(); 573 it.traverseNext(); 574 } else 575 it.traverseNextSkippingChildren(); 576 } 577 } 578 558 579 static bool needsPseudoElement(Element& current, PseudoId pseudoId) 559 580 { … … 583 604 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; 584 605 606 if (isInsertionPoint(current)) { 607 attachDistributedChildren(toInsertionPoint(current), inheritedStyle, renderTreePosition); 608 return; 609 } 610 585 611 if (current.hasCustomStyleResolveCallbacks()) 586 612 current.willAttachRenderers(); … … 588 614 createRendererIfNeeded(current, inheritedStyle, renderTreePosition, resolvedStyle); 589 615 590 StyleResolverParentPusher parentPusher(¤t); 591 592 RenderTreePosition childRenderTreePosition(current.renderer()); 593 attachBeforeOrAfterPseudoElementIfNeeded(current, BEFORE, childRenderTreePosition); 594 595 if (ShadowRoot* shadowRoot = current.shadowRoot()) { 596 parentPusher.push(); 597 attachShadowRoot(*shadowRoot); 598 } else if (current.firstChild()) 599 parentPusher.push(); 600 601 if (isInsertionPoint(current)) 602 attachDistributedChildren(toInsertionPoint(current), inheritedStyle, renderTreePosition); 603 else 604 attachChildren(current, current.renderStyle(), childRenderTreePosition); 616 if (RenderStyle* style = current.renderStyle()) { 617 StyleResolverParentPusher parentPusher(¤t); 618 619 RenderTreePosition childRenderTreePosition(current.renderer()); 620 attachBeforeOrAfterPseudoElementIfNeeded(current, BEFORE, childRenderTreePosition); 621 622 if (ShadowRoot* shadowRoot = current.shadowRoot()) { 623 parentPusher.push(); 624 attachShadowRoot(*shadowRoot); 625 } else if (current.firstChild()) 626 parentPusher.push(); 627 628 attachChildren(current, style, childRenderTreePosition); 629 630 if (AXObjectCache* cache = current.document().axObjectCache()) 631 cache->updateCacheAfterNodeIsAttached(¤t); 632 633 attachBeforeOrAfterPseudoElementIfNeeded(current, AFTER, childRenderTreePosition); 634 635 current.updateFocusAppearanceAfterAttachIfNeeded(); 636 } else 637 resetStyleForNonRenderedDescendants(current); 605 638 606 639 current.clearNeedsStyleRecalc(); 607 640 current.clearChildNeedsStyleRecalc(); 608 609 if (AXObjectCache* cache = current.document().axObjectCache())610 cache->updateCacheAfterNodeIsAttached(¤t);611 612 attachBeforeOrAfterPseudoElementIfNeeded(current, AFTER, childRenderTreePosition);613 614 current.updateFocusAppearanceAfterAttachIfNeeded();615 641 616 642 if (current.hasCustomStyleResolveCallbacks()) … … 885 911 change = resolveLocal(current, inheritedStyle, renderTreePosition, change); 886 912 887 if (change != Detach) { 913 RenderStyle* style = current.renderStyle(); 914 915 if (change != Detach && style) { 888 916 StyleResolverParentPusher parentPusher(¤t); 889 917 … … 918 946 if (change >= Inherit || childElement->childNeedsStyleRecalc() || childElement->needsStyleRecalc()) { 919 947 parentPusher.push(); 920 resolveTree(*childElement, current.renderStyle(), childRenderTreePosition, change);948 resolveTree(*childElement, style, childRenderTreePosition, change); 921 949 } 922 950 forceCheckOfNextElementSibling = childRulesChanged && hasDirectAdjacentRules; … … 926 954 updateBeforeOrAfterPseudoElement(current, change, AFTER, childRenderTreePosition); 927 955 } 956 if (change != Detach && !style) 957 resetStyleForNonRenderedDescendants(current); 928 958 929 959 current.clearNeedsStyleRecalc();
Note: See TracChangeset
for help on using the changeset viewer.