Changeset 107706 in webkit
- Timestamp:
- Feb 14, 2012 4:48:24 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r107590 r107706 1 2012-02-14 Shinya Kawanaka <shinyak@google.com> 2 3 Use youngestShadowRoot and oldestShadowRoot instead of Element::shadowRoot(). 4 https://bugs.webkit.org/show_bug.cgi?id=78455 5 6 Reviewed by Hajime Morita. 7 8 Exports necessary symbols. 9 10 * Source/autotools/symbols.filter: 11 1 12 2012-02-13 Ryosuke Niwa <rniwa@webkit.org> 2 13 -
trunk/Source/WebCore/ChangeLog
r107705 r107706 1 2012-02-14 Shinya Kawanaka <shinyak@google.com> 2 3 Use youngestShadowRoot and oldestShadowRoot instead of Element::shadowRoot(). 4 https://bugs.webkit.org/show_bug.cgi?id=78455 5 6 Reviewed by Hajime Morita. 7 8 Element::shadowRoot() was used for these 3 purposes. 9 1. checks a shadow root exists. 10 2. gets author shadow root. 11 3. gets user agent shadow root. 12 13 We have to distinguish them when implementing multiple shadow subtrees. 14 15 Calling for (1), (2), and (3) are convered to hasShadowRoot(), 16 ShadowRootList()->youngestShadowRoot(), and ShadowRootList()->oldestShadowRoot() respectively. 17 18 No new tests, no change in behavior. 19 20 * WebCore.exp.in: 21 * dom/Document.cpp: 22 (WebCore::Document::buildAccessKeyMap): 23 * dom/Element.cpp: 24 (WebCore::Element::insertedIntoDocument): 25 (WebCore::Element::removedFromDocument): 26 (WebCore::Element::insertedIntoTree): 27 (WebCore::Element::removedFromTree): 28 (WebCore::Element::attach): 29 (WebCore::Element::detach): 30 (WebCore::Element::recalcStyle): 31 (WebCore::Element::ensureShadowRoot): 32 (WebCore::Element::childrenChanged): 33 (WebCore::Element::focus): 34 * dom/Element.h: 35 (Element): 36 * dom/EventDispatcher.cpp: 37 (WebCore::isShadowHost): 38 * dom/Node.cpp: 39 (WebCore::shadowRoot): 40 * dom/NodeRenderingContext.cpp: 41 (WebCore::NodeRenderingContext::NodeRenderingContext): 42 * dom/ShadowRoot.cpp: 43 (WebCore::ShadowRoot::create): 44 * dom/ShadowRootList.cpp: 45 (WebCore::ShadowRootList::insertedIntoDocument): 46 (WebCore): 47 (WebCore::ShadowRootList::removedFromDocument): 48 (WebCore::ShadowRootList::insertedIntoTree): 49 (WebCore::ShadowRootList::removedFromTree): 50 (WebCore::ShadowRootList::hostChildrenChanged): 51 (WebCore::ShadowRootList::attach): 52 (WebCore::ShadowRootList::detach): 53 * dom/ShadowRootList.h: 54 (ShadowRootList): 55 * dom/TreeScopeAdopter.cpp: 56 (WebCore::shadowRootFor): 57 * html/FileInputType.cpp: 58 (WebCore::FileInputType::createShadowSubtree): 59 (WebCore::FileInputType::multipleAttributeChanged): 60 * html/HTMLDetailsElement.cpp: 61 (WebCore::HTMLDetailsElement::createShadowSubtree): 62 (WebCore::HTMLDetailsElement::findMainSummary): 63 * html/HTMLInputElement.cpp: 64 (WebCore::HTMLInputElement::createShadowSubtree): 65 * html/HTMLKeygenElement.cpp: 66 (WebCore::HTMLKeygenElement::HTMLKeygenElement): 67 (WebCore::HTMLKeygenElement::shadowSelect): 68 * html/HTMLMediaElement.cpp: 69 (WebCore::HTMLMediaElement::mediaControls): 70 (WebCore::HTMLMediaElement::hasMediaControls): 71 * html/HTMLMeterElement.cpp: 72 (WebCore::HTMLMeterElement::createShadowSubtree): 73 * html/HTMLProgressElement.cpp: 74 (WebCore::HTMLProgressElement::createShadowSubtree): 75 * html/HTMLSummaryElement.cpp: 76 (WebCore::HTMLSummaryElement::createShadowSubtree): 77 * html/HTMLTextAreaElement.cpp: 78 (WebCore::HTMLTextAreaElement::createShadowSubtree): 79 (WebCore::HTMLTextAreaElement::innerTextElement): 80 (WebCore::HTMLTextAreaElement::updatePlaceholderText): 81 * html/InputType.cpp: 82 (WebCore::InputType::destroyShadowSubtree): 83 * html/RangeInputType.cpp: 84 (WebCore::RangeInputType::handleMouseDownEvent): 85 (WebCore::RangeInputType::createShadowSubtree): 86 * html/TextFieldInputType.cpp: 87 (WebCore::TextFieldInputType::createShadowSubtree): 88 (WebCore::TextFieldInputType::updatePlaceholderText): 89 * html/ValidationMessage.cpp: 90 (WebCore::ValidationMessage::deleteBubbleTree): 91 * html/shadow/SliderThumbElement.cpp: 92 (WebCore::sliderThumbElementOf): 93 (WebCore::RenderSliderContainer::layout): 94 (WebCore::trackLimiterElementOf): 95 * page/FocusController.cpp: 96 (WebCore::shadowRoot): 97 * rendering/RenderFileUploadControl.cpp: 98 (WebCore::RenderFileUploadControl::uploadButton): 99 * svg/SVGTRefElement.cpp: 100 (WebCore::SVGTRefElement::updateReferencedText): 101 * testing/Internals.cpp: 102 (WebCore::Internals::ensureShadowRoot): 103 (WebCore::Internals::shadowRoot): 104 (WebCore): 105 (WebCore::Internals::youngestShadowRoot): 106 (WebCore::Internals::oldestShadowRoot): 107 * testing/Internals.h: 108 (Internals): 109 * testing/Internals.idl: 110 1 111 2012-02-14 Alexander Pavlov <apavlov@chromium.org> 2 112 -
trunk/Source/WebCore/WebCore.exp.in
r107682 r107706 1435 1435 __ZNK7WebCore6Widget9frameRectEv 1436 1436 __ZNK7WebCore7Element10screenRectEv 1437 __ZNK7WebCore7Element10shadowRootEv1438 1437 __ZNK7WebCore7Element12getAttributeERKNS_13QualifiedNameE 1438 __ZNK7WebCore7Element13hasShadowRootEv 1439 __ZNK7WebCore7Element14shadowRootListEv 1439 1440 __ZNK7WebCore7IntRect10intersectsERKS0_ 1440 1441 __ZNK7WebCore7IntRect8containsERKS0_ -
trunk/Source/WebCore/dom/Document.cpp
r107700 r107706 138 138 #include "Settings.h" 139 139 #include "ShadowRoot.h" 140 #include "ShadowRootList.h" 140 141 #include "StaticHashSetNodeList.h" 141 142 #include "StyleSheetList.h" … … 667 668 if (!accessKey.isEmpty()) 668 669 m_elementsByAccessKey.set(accessKey.impl(), element); 669 if (ShadowRoot* shadowRoot = element->shadowRoot()) 670 buildAccessKeyMap(shadowRoot); 670 671 if (element->hasShadowRoot()) { 672 for (ShadowRoot* root = element->shadowRootList()->youngestShadowRoot(); root; root = root->olderShadowRoot()) 673 buildAccessKeyMap(root); 674 } 671 675 } 672 676 } -
trunk/Source/WebCore/dom/Element.cpp
r107663 r107706 874 874 // by the time we reach updateId 875 875 ContainerNode::insertedIntoDocument(); 876 if (ShadowRoot * shadow = shadowRoot())877 shadow ->insertedIntoDocument();876 if (ShadowRootList* shadowRoots = shadowRootList()) 877 shadowRoots->insertedIntoDocument(); 878 878 879 879 if (m_attributeMap) { … … 907 907 908 908 ContainerNode::removedFromDocument(); 909 if (ShadowRoot * shadow = shadowRoot())910 shadow ->removedFromDocument();909 if (ShadowRootList* shadowRoots = shadowRootList()) 910 shadowRoots->removedFromDocument(); 911 911 } 912 912 … … 916 916 if (!deep) 917 917 return; 918 if (ShadowRoot * shadow = shadowRoot())919 shadow ->insertedIntoTree(true);918 if (ShadowRootList* shadowRoots = shadowRootList()) 919 shadowRoots->insertedIntoTree(true); 920 920 921 921 #if ENABLE(FULLSCREEN_API) … … 930 930 if (!deep) 931 931 return; 932 if (ShadowRoot * shadow = shadowRoot())933 shadow ->removedFromTree(true);932 if (ShadowRootList* shadowRoots = shadowRootList()) 933 shadowRoots->removedFromTree(true); 934 934 } 935 935 … … 943 943 944 944 // When a shadow root exists, it does the work of attaching the children. 945 if ( ShadowRoot* shadow = shadowRoot()) {945 if (hasShadowRoot()) { 946 946 parentPusher.push(); 947 947 Node::attach(); 948 shadow ->attach();948 shadowRootList()->attach(); 949 949 950 950 // In a shadow tree, some of light children may be attached by 'content' element. … … 982 982 rareData()->resetComputedStyle(); 983 983 ContainerNode::detach(); 984 if (ShadowRoot * shadow = shadowRoot())985 shadow ->detach();984 if (ShadowRootList* shadowRoots = shadowRootList()) 985 shadowRoots->detach(); 986 986 987 987 RenderWidget::resumeWidgetHierarchyUpdates(); … … 1142 1142 } 1143 1143 // FIXME: This does not care about sibling combinators. Will be necessary in XBL2 world. 1144 if (ShadowRoot* shadow = shadowRoot()) { 1144 if (hasShadowRoot()) { 1145 ShadowRoot* shadow = shadowRootList()->youngestShadowRoot(); 1145 1146 if (change >= Inherit || shadow->childNeedsStyleRecalc() || shadow->needsStyleRecalc()) { 1146 1147 parentPusher.push(); … … 1169 1170 1170 1171 return &rareData()->m_shadowRootList; 1171 }1172 1173 ShadowRoot* Element::shadowRoot() const1174 {1175 if (ShadowRootList* list = shadowRootList())1176 return list->youngestShadowRoot();1177 return 0;1178 1172 } 1179 1173 … … 1220 1214 ShadowRoot* Element::ensureShadowRoot() 1221 1215 { 1222 if ( ShadowRoot* existingRoot = shadowRoot())1223 return existingRoot;1216 if (hasShadowRoot()) 1217 return shadowRootList()->oldestShadowRoot(); 1224 1218 1225 1219 return ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot).get(); … … 1383 1377 1384 1378 if (hasRareData()) { 1385 if (ShadowRoot * root = shadowRoot())1386 root->hostChildrenChanged();1379 if (ShadowRootList* list = shadowRootList()) 1380 list->hostChildrenChanged(); 1387 1381 } 1388 1382 } … … 1581 1575 // does not make sense to continue and update appearence. 1582 1576 protect = this; 1583 if ( shadowRoot() && page->focusController()->transferFocusToElementInShadowRoot(this, restorePreviousSelection))1577 if (hasShadowRoot() && page->focusController()->transferFocusToElementInShadowRoot(this, restorePreviousSelection)) 1584 1578 return; 1585 1579 if (!page->focusController()->setFocusedNode(this, doc->frame())) -
trunk/Source/WebCore/dom/Element.h
r107650 r107706 259 259 // FIXME: These API will be moved to ShadowRootList. 260 260 // https://bugs.webkit.org/show_bug.cgi?id=78313 261 ShadowRoot* shadowRoot() const;262 261 void setShadowRoot(PassRefPtr<ShadowRoot>, ExceptionCode&); 263 262 ShadowRoot* ensureShadowRoot(); -
trunk/Source/WebCore/dom/EventDispatcher.cpp
r105241 r107706 128 128 static inline bool isShadowHost(Node* node) 129 129 { 130 return node->isElementNode() && toElement(node)-> shadowRoot();130 return node->isElementNode() && toElement(node)->hasShadowRoot(); 131 131 } 132 132 -
trunk/Source/WebCore/dom/Node.cpp
r107700 r107706 87 87 #include "SelectorQuery.h" 88 88 #include "ShadowRoot.h" 89 #include "ShadowRootList.h" 89 90 #include "StaticNodeList.h" 90 91 #include "StorageEvent.h" … … 809 810 inline static ShadowRoot* shadowRoot(Node* node) 810 811 { 811 return node->isElementNode() ? toElement(node)->shadowRoot() : 0;812 return node->isElementNode() && toElement(node)->hasShadowRoot() ? toElement(node)->shadowRootList()->youngestShadowRoot() : 0; 812 813 } 813 814 -
trunk/Source/WebCore/dom/NodeRenderingContext.cpp
r107690 r107706 36 36 #include "RenderView.h" 37 37 #include "ShadowRoot.h" 38 #include "ShadowRootList.h" 38 39 39 40 #if ENABLE(SVG) … … 66 67 67 68 if (parent->isElementNode()) { 68 m_visualParentShadowRoot = toElement(parent)->shadowRoot(); 69 if (toElement(parent)->hasShadowRoot()) 70 m_visualParentShadowRoot = toElement(parent)->shadowRootList()->youngestShadowRoot(); 69 71 70 72 if (m_visualParentShadowRoot) { -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r107700 r107706 98 98 PassRefPtr<ShadowRoot> ShadowRoot::create(Element* element, ShadowRootCreationPurpose purpose, ExceptionCode& ec) 99 99 { 100 if (!element || element-> shadowRoot()) {100 if (!element || element->hasShadowRoot()) { 101 101 ec = HIERARCHY_REQUEST_ERR; 102 102 return 0; … … 110 110 } 111 111 112 ASSERT(purpose != CreatingUserAgentShadowRoot || !element-> shadowRoot());112 ASSERT(purpose != CreatingUserAgentShadowRoot || !element->hasShadowRoot()); 113 113 RefPtr<ShadowRoot> shadowRoot = create(element->document()); 114 114 -
trunk/Source/WebCore/dom/ShadowRootList.cpp
r107525 r107706 60 60 } 61 61 62 void ShadowRootList::insertedIntoDocument() 63 { 64 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) 65 root->insertedIntoDocument(); 62 66 } 67 68 void ShadowRootList::removedFromDocument() 69 { 70 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) 71 root->removedFromDocument(); 72 } 73 74 void ShadowRootList::insertedIntoTree(bool deep) 75 { 76 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) 77 root->insertedIntoTree(deep); 78 } 79 80 void ShadowRootList::removedFromTree(bool deep) 81 { 82 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) 83 root->removedFromTree(deep); 84 } 85 86 void ShadowRootList::hostChildrenChanged() 87 { 88 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) 89 root->hostChildrenChanged(); 90 } 91 92 void ShadowRootList::attach() 93 { 94 // FIXME: Currently we only support the case that the shadow root list has at most one shadow root. 95 // See also https://bugs.webkit.org/show_bug.cgi?id=77503 and its dependent bugs. 96 ASSERT(m_shadowRoots.size() <= 1); 97 98 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) { 99 if (!root->attached()) 100 root->attach(); 101 } 102 } 103 104 void ShadowRootList::detach() 105 { 106 // FIXME: Currently we only support the case that the shadow root list has at most one shadow root. 107 // See also https://bugs.webkit.org/show_bug.cgi?id=77503 and its dependent bugs. 108 ASSERT(m_shadowRoots.size() <= 1); 109 110 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) { 111 if (root->attached()) 112 root->detach(); 113 } 114 } 115 116 } -
trunk/Source/WebCore/dom/ShadowRootList.h
r107525 r107706 49 49 ShadowRoot* popShadowRoot(); 50 50 51 void insertedIntoDocument(); 52 void removedFromDocument(); 53 void insertedIntoTree(bool deep); 54 void removedFromTree(bool deep); 55 56 void hostChildrenChanged(); 57 58 void attach(); 59 void detach(); 60 51 61 private: 52 62 DoublyLinkedList<ShadowRoot> m_shadowRoots; -
trunk/Source/WebCore/dom/TreeScopeAdopter.cpp
r107519 r107706 29 29 #include "NodeRareData.h" 30 30 #include "ShadowRoot.h" 31 #include "ShadowRootList.h" 31 32 32 33 namespace WebCore { … … 34 35 static inline ShadowRoot* shadowRootFor(Node* node) 35 36 { 36 return node->isElementNode() ? toElement(node)->shadowRoot() : 0;37 return node->isElementNode() && toElement(node)->hasShadowRoot() ? toElement(node)->shadowRootList()->youngestShadowRoot() : 0; 37 38 } 38 39 -
trunk/Source/WebCore/html/FileInputType.cpp
r107555 r107706 37 37 #include "ScriptController.h" 38 38 #include "ShadowRoot.h" 39 #include "ShadowRootList.h" 39 40 #include <wtf/PassOwnPtr.h> 40 41 #include <wtf/text/StringBuilder.h> … … 266 267 void FileInputType::createShadowSubtree() 267 268 { 268 ASSERT(element()-> shadowRoot());269 ASSERT(element()->hasShadowRoot()); 269 270 ExceptionCode ec = 0; 270 element()->shadowRoot ()->appendChild(element()->multiple() ? UploadButtonElement::createForMultiple(element()->document()): UploadButtonElement::create(element()->document()), ec);271 element()->shadowRootList()->oldestShadowRoot()->appendChild(element()->multiple() ? UploadButtonElement::createForMultiple(element()->document()): UploadButtonElement::create(element()->document()), ec); 271 272 } 272 273 273 274 void FileInputType::multipleAttributeChanged() 274 275 { 275 ASSERT(element()-> shadowRoot());276 UploadButtonElement* button = static_cast<UploadButtonElement*>(element()->shadowRoot ()->firstChild());276 ASSERT(element()->hasShadowRoot()); 277 UploadButtonElement* button = static_cast<UploadButtonElement*>(element()->shadowRootList()->oldestShadowRoot()->firstChild()); 277 278 if (button) 278 279 button->setValue(element()->multiple() ? fileButtonChooseMultipleFilesLabel() : fileButtonChooseFileLabel()); -
trunk/Source/WebCore/html/HTMLDetailsElement.cpp
r107202 r107706 31 31 #include "RenderDetails.h" 32 32 #include "ShadowRoot.h" 33 #include "ShadowRootList.h" 33 34 #include "Text.h" 34 35 … … 109 110 void HTMLDetailsElement::createShadowSubtree() 110 111 { 111 ASSERT(! shadowRoot());112 ASSERT(!hasShadowRoot()); 112 113 113 114 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot); … … 123 124 } 124 125 125 return static_cast<DetailsSummaryElement*>(shadowRoot ()->firstChild())->fallbackSummary();126 return static_cast<DetailsSummaryElement*>(shadowRootList()->oldestShadowRoot()->firstChild())->fallbackSummary(); 126 127 } 127 128 -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r107570 r107706 110 110 void HTMLInputElement::createShadowSubtree() 111 111 { 112 ASSERT(! shadowRoot());112 ASSERT(!hasShadowRoot()); 113 113 ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot, ASSERT_NO_EXCEPTION); 114 114 -
trunk/Source/WebCore/html/HTMLKeygenElement.cpp
r107202 r107706 34 34 #include "SSLKeyGenerator.h" 35 35 #include "ShadowRoot.h" 36 #include "ShadowRootList.h" 36 37 #include "Text.h" 37 38 #include <wtf/StdLibExtras.h> … … 86 87 } 87 88 88 ASSERT(! shadowRoot());89 ASSERT(!hasShadowRoot()); 89 90 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot); 90 91 root->appendChild(select, ec); … … 131 132 HTMLSelectElement* HTMLKeygenElement::shadowSelect() const 132 133 { 133 ShadowRoot* shadow = shadowRoot();134 ASSERT(shadow);134 ASSERT(hasShadowRoot()); 135 ShadowRoot* shadow = shadowRootList()->oldestShadowRoot(); 135 136 return shadow ? toHTMLSelectElement(shadow->firstChild()) : 0; 136 137 } -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r107244 r107706 72 72 #include "Settings.h" 73 73 #include "ShadowRoot.h" 74 #include "ShadowRootList.h" 74 75 #include "TimeRanges.h" 75 76 #include "UUID.h" … … 3520 3521 MediaControls* HTMLMediaElement::mediaControls() 3521 3522 { 3522 return toMediaControls(shadowRoot ()->firstChild());3523 return toMediaControls(shadowRootList()->oldestShadowRoot()->firstChild()); 3523 3524 } 3524 3525 3525 3526 bool HTMLMediaElement::hasMediaControls() 3526 3527 { 3527 if (! shadowRoot())3528 if (!hasShadowRoot()) 3528 3529 return false; 3529 3530 3530 Node* node = shadowRoot ()->firstChild();3531 Node* node = shadowRootList()->oldestShadowRoot()->firstChild(); 3531 3532 return node && node->isMediaControls(); 3532 3533 } -
trunk/Source/WebCore/html/HTMLMeterElement.cpp
r107202 r107706 235 235 void HTMLMeterElement::createShadowSubtree() 236 236 { 237 ASSERT(! shadowRoot());237 ASSERT(!hasShadowRoot()); 238 238 239 239 RefPtr<MeterBarElement> bar = MeterBarElement::create(document()); -
trunk/Source/WebCore/html/HTMLProgressElement.cpp
r107202 r107706 154 154 void HTMLProgressElement::createShadowSubtree() 155 155 { 156 ASSERT(! shadowRoot());156 ASSERT(!hasShadowRoot()); 157 157 158 158 RefPtr<ProgressBarElement> bar = ProgressBarElement::create(document()); -
trunk/Source/WebCore/html/HTMLSummaryElement.cpp
r107548 r107706 32 32 #include "PlatformMouseEvent.h" 33 33 #include "RenderSummary.h" 34 35 34 #include "ShadowRoot.h" 35 #include "ShadowRootList.h" 36 36 37 37 namespace WebCore { … … 75 75 void HTMLSummaryElement::createShadowSubtree() 76 76 { 77 ASSERT(! shadowRoot());77 ASSERT(!hasShadowRoot()); 78 78 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot); 79 79 root->appendChild(DetailsMarkerControl::create(document()), ASSERT_NO_EXCEPTION, true); -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r107554 r107706 39 39 #include "RenderTextControlMultiLine.h" 40 40 #include "ShadowRoot.h" 41 #include "ShadowRootList.h" 41 42 #include "Text.h" 42 43 #include "TextControlInnerElements.h" … … 85 86 void HTMLTextAreaElement::createShadowSubtree() 86 87 { 87 ASSERT(! shadowRoot());88 ASSERT(!hasShadowRoot()); 88 89 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot); 89 90 root->appendChild(TextControlInnerTextElement::create(document()), ASSERT_NO_EXCEPTION); … … 294 295 HTMLElement* HTMLTextAreaElement::innerTextElement() const 295 296 { 296 Node* node = shadowRoot ()->firstChild();297 Node* node = shadowRootList()->oldestShadowRoot()->firstChild(); 297 298 ASSERT(!node || node->hasTagName(divTag)); 298 299 return toHTMLElement(node); … … 471 472 if (placeholderText.isEmpty()) { 472 473 if (m_placeholder) { 473 shadowRoot ()->removeChild(m_placeholder.get(), ec);474 shadowRootList()->oldestShadowRoot()->removeChild(m_placeholder.get(), ec); 474 475 ASSERT(!ec); 475 476 m_placeholder.clear(); … … 480 481 m_placeholder = HTMLDivElement::create(document()); 481 482 m_placeholder->setShadowPseudoId("-webkit-input-placeholder"); 482 shadowRoot ()->insertBefore(m_placeholder, shadowRoot()->firstChild()->nextSibling(), ec);483 shadowRootList()->oldestShadowRoot()->insertBefore(m_placeholder, shadowRootList()->oldestShadowRoot()->firstChild()->nextSibling(), ec); 483 484 ASSERT(!ec); 484 485 } -
trunk/Source/WebCore/html/InputType.cpp
r107555 r107706 57 57 #include "SearchInputType.h" 58 58 #include "ShadowRoot.h" 59 #include "ShadowRootList.h" 59 60 #include "SubmitInputType.h" 60 61 #include "TelephoneInputType.h" … … 379 380 void InputType::destroyShadowSubtree() 380 381 { 381 if (ShadowRoot* root = element()->shadowRoot()) 382 if (!element()->hasShadowRoot()) 383 return; 384 385 if (ShadowRoot* root = element()->shadowRootList()->oldestShadowRoot()) 382 386 root->removeAllChildren(); 383 387 } -
trunk/Source/WebCore/html/RangeInputType.cpp
r107555 r107706 43 43 #include "RenderSlider.h" 44 44 #include "ShadowRoot.h" 45 #include "ShadowRootList.h" 45 46 #include "SliderThumbElement.h" 46 47 #include "StepRange.h" … … 158 159 159 160 Node* targetNode = event->target()->toNode(); 160 if (event->button() != LeftButton || !targetNode || (targetNode != element() && !targetNode->isDescendantOf(element()->shadowRoot()))) 161 if (event->button() != LeftButton || !targetNode) 162 return; 163 ASSERT(element()->hasShadowRoot()); 164 if (targetNode != element() && !targetNode->isDescendantOf(element()->shadowRootList()->oldestShadowRoot())) 161 165 return; 162 166 SliderThumbElement* thumb = sliderThumbElementOf(element()); … … 234 238 void RangeInputType::createShadowSubtree() 235 239 { 236 ASSERT(element()-> shadowRoot());240 ASSERT(element()->hasShadowRoot()); 237 241 238 242 Document* document = element()->document(); … … 244 248 container->appendChild(track.release(), ec); 245 249 container->appendChild(TrackLimiterElement::create(document), ec); 246 element()->shadowRoot ()->appendChild(container.release(), ec);250 element()->shadowRootList()->oldestShadowRoot()->appendChild(container.release(), ec); 247 251 } 248 252 -
trunk/Source/WebCore/html/TextFieldInputType.cpp
r107555 r107706 44 44 #include "RenderTheme.h" 45 45 #include "ShadowRoot.h" 46 #include "ShadowRootList.h" 46 47 #include "TextControlInnerElements.h" 47 48 #include "TextEvent.h" … … 190 191 void TextFieldInputType::createShadowSubtree() 191 192 { 192 ASSERT(element()-> shadowRoot());193 ASSERT(element()->hasShadowRoot()); 193 194 194 195 ASSERT(!m_innerText); … … 204 205 m_innerText = TextControlInnerTextElement::create(document); 205 206 if (!createsContainer) { 206 element()->shadowRoot ()->appendChild(m_innerText, ec);207 return; 208 } 209 210 ShadowRoot* shadowRoot = element()->shadowRoot ();207 element()->shadowRootList()->oldestShadowRoot()->appendChild(m_innerText, ec); 208 return; 209 } 210 211 ShadowRoot* shadowRoot = element()->shadowRootList()->oldestShadowRoot(); 211 212 m_container = HTMLDivElement::create(document); 212 213 m_container->setShadowPseudoId("-webkit-textfield-decoration-container"); … … 370 371 m_placeholder = HTMLDivElement::create(element()->document()); 371 372 m_placeholder->setShadowPseudoId("-webkit-input-placeholder"); 372 element()->shadowRoot ()->insertBefore(m_placeholder, m_container ? m_container->nextSibling() : innerTextElement()->nextSibling(), ec);373 element()->shadowRootList()->oldestShadowRoot()->insertBefore(m_placeholder, m_container ? m_container->nextSibling() : innerTextElement()->nextSibling(), ec); 373 374 ASSERT(!ec); 374 375 } -
trunk/Source/WebCore/html/ValidationMessage.cpp
r106681 r107706 45 45 #include "Settings.h" 46 46 #include "ShadowRoot.h" 47 #include "ShadowRootList.h" 47 48 #include "Text.h" 48 49 #include <wtf/PassOwnPtr.h> … … 188 189 HTMLElement* host = toHTMLElement(m_element); 189 190 ExceptionCode ec; 190 host->shadowRoot ()->removeChild(m_bubble.get(), ec);191 host->shadowRootList()->oldestShadowRoot()->removeChild(m_bubble.get(), ec); 191 192 m_bubble = 0; 192 193 } -
trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp
r106681 r107706 44 44 #include "RenderTheme.h" 45 45 #include "ShadowRoot.h" 46 #include "ShadowRootList.h" 46 47 #include "StepRange.h" 47 48 #include <wtf/MathExtras.h> … … 67 68 { 68 69 ASSERT(node); 69 ShadowRoot* shadow = node->toInputElement()->shadowRoot ();70 ShadowRoot* shadow = node->toInputElement()->shadowRootList()->oldestShadowRoot(); 70 71 ASSERT(shadow); 71 72 Node* thumb = shadow->firstChild()->firstChild()->firstChild(); … … 142 143 RenderObject* trackRenderer = node()->firstChild()->renderer(); 143 144 if (!isVertical && input->renderer()->isSlider() && !inputHeight.isFixed() && !inputHeight.isPercent()) { 144 RenderObject* thumbRenderer = input->shadowRoot ()->firstChild()->firstChild()->firstChild()->renderer();145 RenderObject* thumbRenderer = input->shadowRootList()->oldestShadowRoot()->firstChild()->firstChild()->firstChild()->renderer(); 145 146 if (thumbRenderer) { 146 147 style()->setHeight(thumbRenderer->style()->height()); … … 356 357 { 357 358 ASSERT(node); 358 ShadowRoot* shadow = node->toInputElement()->shadowRoot(); 359 ASSERT(node->toInputElement()->hasShadowRoot()); 360 ShadowRoot* shadow = node->toInputElement()->shadowRootList()->oldestShadowRoot(); 359 361 ASSERT(shadow); 360 362 Node* limiter = shadow->firstChild()->lastChild(); -
trunk/Source/WebCore/page/FocusController.cpp
r106977 r107706 55 55 #include "Settings.h" 56 56 #include "ShadowRoot.h" 57 #include "ShadowRootList.h" 57 58 #include "SpatialNavigation.h" 58 59 #include "Widget.h" … … 155 156 static inline ShadowRoot* shadowRoot(Node* node) 156 157 { 157 return node->isElementNode() ? toElement(node)->shadowRoot() : 0;158 return node->isElementNode() && toElement(node)->hasShadowRoot() ? toElement(node)->shadowRootList()->youngestShadowRoot() : 0; 158 159 } 159 160 -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r99369 r107706 33 33 #include "RenderTheme.h" 34 34 #include "ShadowRoot.h" 35 #include "ShadowRootList.h" 35 36 #include "TextRun.h" 36 37 #include "VisiblePosition.h" … … 213 214 HTMLInputElement* input = static_cast<HTMLInputElement*>(node()); 214 215 215 ASSERT(input-> shadowRoot());216 217 Node* buttonNode = input->shadowRoot ()->firstChild();216 ASSERT(input->hasShadowRoot()); 217 218 Node* buttonNode = input->shadowRootList()->oldestShadowRoot()->firstChild(); 218 219 return buttonNode && buttonNode->isHTMLElement() && buttonNode->hasTagName(inputTag) ? static_cast<HTMLInputElement*>(buttonNode) : 0; 219 220 } -
trunk/Source/WebCore/svg/SVGTRefElement.cpp
r107523 r107706 32 32 #include "RenderSVGResource.h" 33 33 #include "ShadowRoot.h" 34 #include "ShadowRootList.h" 34 35 #include "SVGDocument.h" 35 36 #include "SVGElementInstance.h" … … 160 161 textContent = target->textContent(); 161 162 162 if (!shadowRoot()->firstChild()) 163 shadowRoot()->appendChild(SVGShadowText::create(document(), textContent), ASSERT_NO_EXCEPTION); 163 ASSERT(hasShadowRoot()); 164 ShadowRoot* root = shadowRootList()->oldestShadowRoot(); 165 if (!root->firstChild()) 166 root->appendChild(SVGShadowText::create(document(), textContent), ASSERT_NO_EXCEPTION); 164 167 else 165 shadowRoot()->firstChild()->setTextContent(textContent, ASSERT_NO_EXCEPTION);168 root->firstChild()->setTextContent(textContent, ASSERT_NO_EXCEPTION); 166 169 } 167 170 -
trunk/Source/WebCore/testing/Internals.cpp
r107665 r107706 51 51 #include "Settings.h" 52 52 #include "ShadowRoot.h" 53 #include "ShadowRootList.h" 53 54 #include "SpellChecker.h" 54 55 #include "TextIterator.h" … … 186 187 } 187 188 188 if ( ShadowRoot* root = host->shadowRoot())189 return root;189 if (host->hasShadowRoot()) 190 return host->shadowRootList()->youngestShadowRoot(); 190 191 191 192 return ShadowRoot::create(host, ec).get(); … … 194 195 Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::shadowRoot(Element* host, ExceptionCode& ec) 195 196 { 197 // FIXME: Internals::shadowRoot() in tests should be converted to youngestShadowRoot() or oldestShadowRoot(). 198 // https://bugs.webkit.org/show_bug.cgi?id=78465 199 return youngestShadowRoot(host, ec); 200 } 201 202 Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::youngestShadowRoot(Element* host, ExceptionCode& ec) 203 { 196 204 if (!host) { 197 205 ec = INVALID_ACCESS_ERR; … … 199 207 } 200 208 201 return host->shadowRoot(); 209 if (!host->hasShadowRoot()) 210 return 0; 211 212 return host->shadowRootList()->youngestShadowRoot(); 213 } 214 215 Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::oldestShadowRoot(Element* host, ExceptionCode& ec) 216 { 217 if (!host) { 218 ec = INVALID_ACCESS_ERR; 219 return 0; 220 } 221 222 if (!host->hasShadowRoot()) 223 return 0; 224 225 return host->shadowRootList()->oldestShadowRoot(); 202 226 } 203 227 -
trunk/Source/WebCore/testing/Internals.h
r107176 r107706 67 67 ShadowRootIfShadowDOMEnabledOrNode* ensureShadowRoot(Element* host, ExceptionCode&); 68 68 ShadowRootIfShadowDOMEnabledOrNode* shadowRoot(Element* host, ExceptionCode&); 69 ShadowRootIfShadowDOMEnabledOrNode* youngestShadowRoot(Element* host, ExceptionCode&); 70 ShadowRootIfShadowDOMEnabledOrNode* oldestShadowRoot(Element* host, ExceptionCode&); 69 71 void removeShadowRoot(Element* host, ExceptionCode&); 70 72 Element* includerFor(Node*, ExceptionCode&); -
trunk/Source/WebCore/testing/Internals.idl
r107176 r107706 36 36 ShadowRoot ensureShadowRoot(in Element host) raises (DOMException); 37 37 ShadowRoot shadowRoot(in Element host) raises (DOMException); 38 ShadowRoot youngestShadowRoot(in Element host) raises (DOMException); 39 ShadowRoot oldestShadowRoot(in Element host) raises (DOMException); 38 40 #else 39 41 Node ensureShadowRoot(in Element host) raises (DOMException); 40 42 Node shadowRoot(in Element host) raises (DOMException); 43 Node youngestShadowRoot(in Element host) raises (DOMException); 44 Node oldestShadowRoot(in Element host) raises (DOMException); 41 45 #endif 42 46 Element includerFor(in Node node) raises (DOMException); -
trunk/Source/WebKit2/ChangeLog
r107689 r107706 1 2012-02-14 Shinya Kawanaka <shinyak@google.com> 2 3 Use youngestShadowRoot and oldestShadowRoot instead of Element::shadowRoot(). 4 https://bugs.webkit.org/show_bug.cgi?id=78455 5 6 Reviewed by Hajime Morita. 7 8 Exports necesarry symbols. 9 10 * win/WebKit2.def: 11 * win/WebKit2CFLite.def: 12 1 13 2012-02-14 Alexey Proskuryakov <ap@apple.com> 2 14 -
trunk/Source/WebKit2/win/WebKit2.def
r107176 r107706 164 164 ?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z 165 165 ?getLocationAndLengthFromRange@TextIterator@WebCore@@SA_NPAVElement@2@PBVRange@2@AAI2@Z 166 ?hasShadowRoot@Element@WebCore@@QBE_NXZ 166 167 ?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z 167 168 ?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z … … 188 189 ?settings@Frame@WebCore@@QBEPAVSettings@2@XZ 189 190 ?setFixedElementsLayoutRelativeToFrame@Settings@WebCore@@QAEX_N@Z 190 ?shadowRoot @Element@WebCore@@QBEPAVShadowRoot@2@XZ191 ?shadowRootList@Element@WebCore@@QBEPAVShadowRootList@2@XZ 191 192 ?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ 192 193 ?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z -
trunk/Source/WebKit2/win/WebKit2CFLite.def
r107176 r107706 1 1 2 EXPORTS 2 3 DllGetClassObject PRIVATE … … 158 159 ?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z 159 160 ?getLocationAndLengthFromRange@TextIterator@WebCore@@SA_NPAVElement@2@PBVRange@2@AAI2@Z 161 ?hasShadowRoot@Element@WebCore@@QBE_NXZ 160 162 ?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z 161 163 ?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z … … 182 184 ?settings@Frame@WebCore@@QBEPAVSettings@2@XZ 183 185 ?setFixedElementsLayoutRelativeToFrame@Settings@WebCore@@QAEX_N@Z 184 ?shadowRoot @Element@WebCore@@QBEPAVShadowRoot@2@XZ186 ?shadowRootList@Element@WebCore@@QBEPAVShadowRootList@2@XZ 185 187 ?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ 186 188 ?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z -
trunk/Source/autotools/symbols.filter
r107250 r107706 79 79 _ZNK7WebCore5Frame8settingsEv; 80 80 _ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE; 81 _ZNK7WebCore7Element10shadowRootEv;82 81 _ZNK7WebCore7Element31numberOfScopedHTMLStyleChildrenEv; 82 _ZNK7WebCore7Element13hasShadowRootEv; 83 _ZNK7WebCore7Element14shadowRootListEv; 83 84 _ZNK7WebCore8Document4pageEv; 84 85 _ZNK7WebCore8Document8settingsEv;
Note: See TracChangeset
for help on using the changeset viewer.