Changeset 122298 in webkit
- Timestamp:
- Jul 10, 2012 10:43:06 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r122295 r122298 1 2012-07-10 Shinya Kawanaka <shinyak@chromium.org> 2 3 ShadowRoot should know its type in debug build. 4 https://bugs.webkit.org/show_bug.cgi?id=90933 5 6 Reviewed by Hajime Morita. 7 8 For assertion, ShadowRoot should know its type is UserAgentShadowRoot or AuthorShadowRoot. 9 10 This patch also renames ShadowRootCreationPurpose to ShadowRootType, since it is suitable 11 name for ShadowRoot to have. 12 13 No new tests, since it is used only for assertion. 14 15 * dom/Element.cpp: 16 (WebCore::Element::ensureShadowRoot): 17 * dom/ShadowRoot.cpp: 18 (WebCore::ShadowRoot::create): 19 * dom/ShadowRoot.h: 20 (ShadowRoot): 21 (WebCore::ShadowRoot::type): 22 * html/HTMLDetailsElement.cpp: 23 (WebCore::HTMLDetailsElement::createShadowSubtree): 24 * html/HTMLInputElement.cpp: 25 (WebCore::HTMLInputElement::createShadowSubtree): 26 * html/HTMLKeygenElement.cpp: 27 (WebCore::HTMLKeygenElement::HTMLKeygenElement): 28 * html/HTMLMeterElement.cpp: 29 (WebCore::HTMLMeterElement::createShadowSubtree): 30 * html/HTMLProgressElement.cpp: 31 (WebCore::HTMLProgressElement::createShadowSubtree): 32 * html/HTMLSummaryElement.cpp: 33 (WebCore::HTMLSummaryElement::createShadowSubtree): 34 * html/HTMLTextAreaElement.cpp: 35 (WebCore::HTMLTextAreaElement::createShadowSubtree): 36 * html/InputType.cpp: 37 (WebCore::InputType::destroyShadowSubtree): Asserts that ShadowRoot type is UserAgentShadowRoot. 38 * html/shadow/TextFieldDecorationElement.cpp: 39 (WebCore::getDecorationRootAndDecoratedRoot): 40 * svg/SVGTRefElement.cpp: 41 (WebCore::SVGTRefElement::createShadowSubtree): 42 1 43 2012-07-10 George Staikos <staikos@webkit.org> 2 44 -
trunk/Source/WebCore/dom/Element.cpp
r122188 r122298 1182 1182 return shadow->oldestShadowRoot(); 1183 1183 1184 return ShadowRoot::create(this, ShadowRoot:: CreatingUserAgentShadowRoot).get();1184 return ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot).get(); 1185 1185 } 1186 1186 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r119799 r122298 100 100 PassRefPtr<ShadowRoot> ShadowRoot::create(Element* element, ExceptionCode& ec) 101 101 { 102 return create(element, CreatingAuthorShadowRoot, ec);103 } 104 105 PassRefPtr<ShadowRoot> ShadowRoot::create(Element* element, ShadowRoot CreationPurpose purpose, ExceptionCode& ec)102 return create(element, AuthorShadowRoot, ec); 103 } 104 105 PassRefPtr<ShadowRoot> ShadowRoot::create(Element* element, ShadowRootType type, ExceptionCode& ec) 106 106 { 107 107 if (!element) { … … 112 112 // Since some elements recreates shadow root dynamically, multiple shadow subtrees won't work well in that element. 113 113 // Until they are fixed, we disable adding author shadow root for them. 114 if ( purpose == CreatingAuthorShadowRoot && !allowsAuthorShadowRoot(element)) {114 if (type == AuthorShadowRoot && !allowsAuthorShadowRoot(element)) { 115 115 ec = HIERARCHY_REQUEST_ERR; 116 116 return 0; … … 118 118 119 119 RefPtr<ShadowRoot> shadowRoot = adoptRef(new ShadowRoot(element->document())); 120 #ifndef NDEBUG 121 shadowRoot->m_type = type; 122 #endif 120 123 121 124 ec = 0; -
trunk/Source/WebCore/dom/ShadowRoot.h
r119799 r122298 52 52 // in several elements for a while. 53 53 // See https://bugs.webkit.org/show_bug.cgi?id=77503 and related bugs. 54 enum ShadowRoot CreationPurpose {55 CreatingUserAgentShadowRoot,56 CreatingAuthorShadowRoot,54 enum ShadowRootType { 55 UserAgentShadowRoot, 56 AuthorShadowRoot 57 57 }; 58 static PassRefPtr<ShadowRoot> create(Element*, ShadowRoot CreationPurpose, ExceptionCode& = ASSERT_NO_EXCEPTION);58 static PassRefPtr<ShadowRoot> create(Element*, ShadowRootType, ExceptionCode& = ASSERT_NO_EXCEPTION); 59 59 60 60 void recalcShadowTreeStyle(StyleChange); … … 90 90 void setAssignedTo(InsertionPoint*); 91 91 92 #ifndef NDEBUG 93 ShadowRootType type() const { return m_type; } 94 #endif 95 92 96 private: 93 97 ShadowRoot(Document*); … … 103 107 bool m_resetStyleInheritance : 1; 104 108 InsertionPoint* m_insertionPointAssignedTo; 109 110 #ifndef NDEBUG 111 ShadowRootType m_type; 112 #endif 105 113 }; 106 114 -
trunk/Source/WebCore/html/HTMLDetailsElement.cpp
r117195 r122298 113 113 ASSERT(!shadow()); 114 114 115 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot:: CreatingUserAgentShadowRoot);115 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot); 116 116 root->appendChild(DetailsSummaryElement::create(document()), ASSERT_NO_EXCEPTION, true); 117 117 root->appendChild(DetailsContentElement::create(document()), ASSERT_NO_EXCEPTION, true); -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r122286 r122298 119 119 { 120 120 ASSERT(!shadow()); 121 ShadowRoot::create(this, ShadowRoot:: CreatingUserAgentShadowRoot, ASSERT_NO_EXCEPTION);121 ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot, ASSERT_NO_EXCEPTION); 122 122 123 123 m_inputType->createShadowSubtree(); -
trunk/Source/WebCore/html/HTMLKeygenElement.cpp
r117195 r122298 88 88 89 89 ASSERT(!shadow()); 90 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot:: CreatingUserAgentShadowRoot);90 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot); 91 91 root->appendChild(select, ec); 92 92 } -
trunk/Source/WebCore/html/HTMLMeterElement.cpp
r117929 r122298 229 229 bar->appendChild(m_value, ec); 230 230 231 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot:: CreatingUserAgentShadowRoot);231 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot); 232 232 root->appendChild(bar, ec); 233 233 } -
trunk/Source/WebCore/html/HTMLProgressElement.cpp
r118236 r122298 152 152 bar->appendChild(m_value, ASSERT_NO_EXCEPTION); 153 153 154 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot:: CreatingUserAgentShadowRoot, ASSERT_NO_EXCEPTION);154 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot, ASSERT_NO_EXCEPTION); 155 155 root->appendChild(bar, ASSERT_NO_EXCEPTION); 156 156 } -
trunk/Source/WebCore/html/HTMLSummaryElement.cpp
r116730 r122298 82 82 { 83 83 ASSERT(!shadow()); 84 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot:: CreatingUserAgentShadowRoot);84 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot); 85 85 root->appendChild(DetailsMarkerControl::create(document()), ASSERT_NO_EXCEPTION, true); 86 86 root->appendChild(SummaryContentElement::create(document()), ASSERT_NO_EXCEPTION, true); -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r121552 r122298 90 90 { 91 91 ASSERT(!shadow()); 92 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot:: CreatingUserAgentShadowRoot);92 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot); 93 93 root->appendChild(TextControlInnerTextElement::create(document()), ASSERT_NO_EXCEPTION); 94 94 } -
trunk/Source/WebCore/html/InputType.cpp
r122286 r122298 454 454 455 455 ShadowRoot* root = shadow->oldestShadowRoot(); 456 ASSERT(root->type() == ShadowRoot::UserAgentShadowRoot); 456 457 root->removeAllChildren(); 457 458 -
trunk/Source/WebCore/html/shadow/TextFieldDecorationElement.cpp
r119020 r122298 90 90 newRoot->removeChild(newRoot->firstChild()); 91 91 else 92 newRoot = ShadowRoot::create(input, ShadowRoot:: CreatingUserAgentShadowRoot, ASSERT_NO_EXCEPTION).get();92 newRoot = ShadowRoot::create(input, ShadowRoot::UserAgentShadowRoot, ASSERT_NO_EXCEPTION).get(); 93 93 decorationRoot = newRoot; 94 94 decoratedRoot = existingRoot; -
trunk/Source/WebCore/svg/SVGTRefElement.cpp
r121508 r122298 156 156 void SVGTRefElement::createShadowSubtree() 157 157 { 158 ShadowRoot::create(this, ShadowRoot:: CreatingUserAgentShadowRoot, ASSERT_NO_EXCEPTION);158 ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot, ASSERT_NO_EXCEPTION); 159 159 } 160 160
Note: See TracChangeset
for help on using the changeset viewer.