Changeset 161205 in webkit
- Timestamp:
- Jan 2, 2014, 1:49:41 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r161204 r161205 1 2014-01-01 Antti Koivisto <antti@apple.com> 2 3 Remove public attachRenderTree 4 https://bugs.webkit.org/show_bug.cgi?id=126368 5 6 Reviewed by Andreas Kling. 7 8 Remove the remaining explicit render tree construction. 9 10 * dom/Document.cpp: 11 (WebCore::Document::createRenderTree): 12 13 Use recalcStyle() instead of calling attachRenderTree directly. 14 15 * html/HTMLViewSourceDocument.cpp: 16 (WebCore::HTMLViewSourceDocument::addText): 17 18 Remove forgotten attachTextRenderer. 19 20 * html/shadow/InsertionPoint.cpp: 21 (WebCore::InsertionPoint::InsertionPoint): 22 23 Remove willAttachRenderers/didAttachRenderers hack. 24 25 * html/shadow/InsertionPoint.h: 26 (WebCore::toInsertionPoint): 27 * loader/PlaceholderDocument.cpp: 28 (WebCore::PlaceholderDocument::createRenderTree): 29 30 Seriously, nothing to do here. 31 32 * style/StyleResolveTree.cpp: 33 (WebCore::Style::attachDistributedChildren): 34 (WebCore::Style::attachChildren): 35 (WebCore::Style::detachDistributedChildren): 36 (WebCore::Style::detachChildren): 37 38 Making attaching and detaching distributed insertion point children part of ResolveTree internals. 39 40 * style/StyleResolveTree.h: 41 42 Remove interfaces with no clients. 43 1 44 2014-01-01 Seokju Kwon <seokju@webkit.org> 2 45 -
trunk/Source/WebCore/dom/Document.cpp
r161203 r161205 1960 1960 1961 1961 recalcStyle(Style::Force); 1962 1963 if (m_documentElement)1964 Style::attachRenderTree(*m_documentElement);1965 1962 } 1966 1963 -
trunk/Source/WebCore/html/HTMLViewSourceDocument.cpp
r161195 r161205 241 241 RefPtr<Text> text = Text::create(*this, substring); 242 242 m_current->parserAppendChild(text); 243 Style::attachTextRenderer(*text);244 243 if (i < size - 1) 245 244 finishLine(); -
trunk/Source/WebCore/html/shadow/InsertionPoint.cpp
r160908 r161205 44 44 , m_hasDistribution(false) 45 45 { 46 setHasCustomStyleResolveCallbacks();47 46 } 48 47 49 48 InsertionPoint::~InsertionPoint() 50 49 { 51 }52 53 void InsertionPoint::willAttachRenderers()54 {55 if (ShadowRoot* shadowRoot = containingShadowRoot())56 ContentDistributor::ensureDistribution(shadowRoot);57 for (Node* current = firstDistributed(); current; current = nextDistributedTo(current)) {58 if (current->isTextNode()) {59 if (current->renderer())60 continue;61 Style::attachTextRenderer(*toText(current));62 continue;63 }64 if (current->isElementNode()) {65 if (current->renderer())66 Style::detachRenderTree(*toElement(current));67 Style::attachRenderTree(*toElement(current));68 }69 }70 }71 72 void InsertionPoint::willDetachRenderers()73 {74 for (Node* current = firstDistributed(); current; current = nextDistributedTo(current)) {75 if (current->isTextNode()) {76 Style::detachTextRenderer(*toText(current));77 continue;78 }79 if (current->isElementNode())80 Style::detachRenderTree(*toElement(current));81 }82 50 } 83 51 -
trunk/Source/WebCore/html/shadow/InsertionPoint.h
r159036 r161205 56 56 virtual MatchType matchTypeFor(Node*) const { return AlwaysMatches; } 57 57 58 virtual void willAttachRenderers() OVERRIDE;59 virtual void willDetachRenderers() OVERRIDE;60 61 58 bool shouldUseFallbackElements() const; 62 59 … … 79 76 }; 80 77 81 inline InsertionPoint* toInsertionPoint(Node* node) 82 { 83 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isInsertionPoint()); 84 return static_cast<InsertionPoint*>(node); 85 } 78 inline bool isInsertionPoint(const Node& node) { return node.isInsertionPoint(); } 86 79 87 inline const InsertionPoint* toInsertionPoint(const Node* node) 88 { 89 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isInsertionPoint()); 90 return static_cast<const InsertionPoint*>(node); 91 } 80 NODE_TYPE_CASTS(InsertionPoint); 92 81 93 82 inline bool isActiveInsertionPoint(const Node* node) -
trunk/Source/WebCore/loader/PlaceholderDocument.cpp
r161196 r161205 34 34 { 35 35 ASSERT(!renderView()); 36 37 for (auto& child : childrenOfType<Element>(*this))38 Style::attachRenderTree(child);39 36 } 40 37 -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r161199 r161205 35 35 #include "ElementTraversal.h" 36 36 #include "FlowThreadController.h" 37 #include "InsertionPoint.h" 37 38 #include "NodeRenderStyle.h" 38 39 #include "NodeRenderingTraversal.h" … … 62 63 63 64 static void attachRenderTree(Element&, PassRefPtr<RenderStyle>); 65 static void attachTextRenderer(Text&); 64 66 static void detachRenderTree(Element&, DetachType); 65 67 … … 297 299 static void reattachTextRenderersForWhitespaceOnlySiblingsAfterAttachIfNeeded(Node& current) 298 300 { 299 if ( current.isInsertionPoint())301 if (isInsertionPoint(current)) 300 302 return; 301 303 // This function finds sibling text renderers where the results of textRendererIsNeeded may have changed as a result of … … 432 434 } 433 435 436 static void attachDistributedChildren(InsertionPoint& insertionPoint) 437 { 438 if (ShadowRoot* shadowRoot = insertionPoint.containingShadowRoot()) 439 ContentDistributor::ensureDistribution(shadowRoot); 440 for (Node* current = insertionPoint.firstDistributed(); current; current = insertionPoint.nextDistributedTo(current)) { 441 if (current->isTextNode()) { 442 if (current->renderer()) 443 continue; 444 attachTextRenderer(*toText(current)); 445 continue; 446 } 447 if (current->isElementNode()) { 448 if (current->renderer()) 449 detachRenderTree(*toElement(current)); 450 attachRenderTree(*toElement(current), nullptr); 451 } 452 } 453 } 454 434 455 static void attachChildren(ContainerNode& current) 435 456 { 457 if (isInsertionPoint(current)) 458 attachDistributedChildren(toInsertionPoint(current)); 459 436 460 for (Node* child = current.firstChild(); child; child = child->nextSibling()) { 437 ASSERT(!child->renderer() || current.shadowRoot() || current.isInsertionPoint());461 ASSERT(!child->renderer() || current.shadowRoot() || isInsertionPoint(current)); 438 462 if (child->renderer()) 439 463 continue; … … 550 574 } 551 575 576 static void detachDistributedChildren(InsertionPoint& insertionPoint) 577 { 578 for (Node* current = insertionPoint.firstDistributed(); current; current = insertionPoint.nextDistributedTo(current)) { 579 if (current->isTextNode()) { 580 detachTextRenderer(*toText(current)); 581 continue; 582 } 583 if (current->isElementNode()) 584 detachRenderTree(*toElement(current)); 585 } 586 } 587 552 588 static void detachChildren(ContainerNode& current, DetachType detachType) 553 589 { 590 if (isInsertionPoint(current)) 591 detachDistributedChildren(toInsertionPoint(current)); 592 554 593 for (Node* child = current.firstChild(); child; child = child->nextSibling()) { 555 594 if (child->isTextNode()) { … … 876 915 } 877 916 878 void attachRenderTree(Element& element)879 {880 attachRenderTree(element, nullptr);881 reattachTextRenderersForWhitespaceOnlySiblingsAfterAttachIfNeeded(element);882 }883 884 917 void detachRenderTree(Element& element) 885 918 { … … 887 920 } 888 921 889 void detachRenderTreeInReattachMode(Element& element) 890 { 891 detachRenderTree(element, ReattachDetach); 892 } 893 894 } 895 } 922 } 923 } -
trunk/Source/WebCore/style/StyleResolveTree.h
r161199 r161205 42 42 void resolveTree(Document&, Change); 43 43 44 void attachRenderTree(Element&);45 44 void detachRenderTree(Element&); 46 // FIXME: This is only used for "lazy reattach" for shadow trees.47 void detachRenderTreeInReattachMode(Element&);48 45 49 void attachTextRenderer(Text&);50 46 void detachTextRenderer(Text&); 51 47 void updateTextRendererAfterContentChange(Text&, unsigned offsetOfReplacedData, unsigned lengthOfReplacedData);
Note:
See TracChangeset
for help on using the changeset viewer.