Changeset 131136 in webkit
- Timestamp:
- Oct 11, 2012 8:51:37 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r131134 r131136 1 2012-10-11 Takashi Sakamoto <tasak@google.com> 2 3 [Shadow DOM] Insertion points need resetStyleInheritance 4 https://bugs.webkit.org/show_bug.cgi?id=93922 5 6 Reviewed by Dimitri Glazkov. 7 8 * fast/dom/shadow/insertion-point-resetStyleInheritance-expected.txt: Added. 9 * fast/dom/shadow/insertion-point-resetStyleInheritance.html: Added. 10 1 11 2012-10-11 Kenichi Ishibashi <bashi@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r131135 r131136 1 2012-10-11 Takashi Sakamoto <tasak@google.com> 2 3 [Shadow DOM] Insertion points need resetStyleInheritance 4 https://bugs.webkit.org/show_bug.cgi?id=93922 5 6 Reviewed by Dimitri Glazkov. 7 8 Implemented resetStyleInheritance of insertion points. 9 Its spec link is http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#api-html-content-element-reset-style-inheritance 10 11 Test: fast/dom/shadow/insertion-point-resetStyleInheritance.html 12 13 * css/StyleResolver.cpp: 14 (WebCore::isResetStyleInheritance): 15 Added a new function to check whether there exists any insertion 16 point which has reset-style-inhertiance flag set to be true. 17 (WebCore::StyleResolver::initForStyleResolve): 18 Modified to use the above function to check reset-style-inheritance. 19 * html/shadow/HTMLContentElement.idl: 20 * html/shadow/HTMLShadowElement.idl: 21 Added a new attribute for reset-style-inheritance. 22 * html/shadow/InsertionPoint.cpp: 23 (WebCore::InsertionPoint::InsertionPoint): 24 Initialized a new member variable for reset-style-inheritance. 25 (WebCore::InsertionPoint::resetStyleInheritance): 26 (WebCore::InsertionPoint::setResetStyleInheritance): 27 Implemented setter/getter for reset-style-inheritance. 28 * html/shadow/InsertionPoint.h: 29 (InsertionPoint): 30 Added a new member variable for reset-style-inheritance. 31 1 32 2012-10-11 Anders Carlsson <andersca@apple.com> 2 33 -
trunk/Source/WebCore/css/StyleResolver.cpp
r131068 r131136 62 62 #include "CursorList.h" 63 63 #include "DocumentStyleSheetCollection.h" 64 #include "ElementShadow.h" 64 65 #include "FontFeatureValue.h" 65 66 #include "FontValue.h" … … 959 960 } 960 961 962 inline bool shouldResetStyleInheritance(NodeRenderingContext& context) 963 { 964 if (context.resetStyleInheritance()) 965 return true; 966 967 InsertionPoint* insertionPoint = context.insertionPoint(); 968 if (!insertionPoint) 969 return false; 970 ASSERT(context.node()->parentElement()); 971 ElementShadow* shadow = context.node()->parentElement()->shadow(); 972 ASSERT(shadow); 973 974 for ( ; insertionPoint; ) { 975 InsertionPoint* youngerInsertionPoint = shadow->insertionPointFor(insertionPoint); 976 if (!youngerInsertionPoint) 977 break; 978 insertionPoint = youngerInsertionPoint; 979 } 980 return insertionPoint->resetStyleInheritance(); 981 } 982 961 983 inline void StyleResolver::initForStyleResolve(Element* e, RenderStyle* parentStyle, PseudoId pseudoID) 962 984 { … … 966 988 NodeRenderingContext context(e); 967 989 m_parentNode = context.parentNodeForRenderingAndStyle(); 968 m_parentStyle = context.resetStyleInheritance()? 0 :990 m_parentStyle = shouldResetStyleInheritance(context) ? 0 : 969 991 parentStyle ? parentStyle : 970 992 m_parentNode ? m_parentNode->renderStyle() : 0; -
trunk/Source/WebCore/html/shadow/HTMLContentElement.idl
r106666 r131136 31 31 ] HTMLContentElement : HTMLElement { 32 32 attribute [Reflect] DOMString select; 33 attribute boolean resetStyleInheritance; 33 34 }; 34 35 } -
trunk/Source/WebCore/html/shadow/HTMLShadowElement.idl
r108298 r131136 35 35 V8EnabledAtRuntime=shadowDOM 36 36 ] HTMLShadowElement : HTMLElement { 37 attribute boolean resetStyleInheritance; 37 38 }; 38 39 -
trunk/Source/WebCore/html/shadow/InsertionPoint.cpp
r130926 r131136 40 40 InsertionPoint::InsertionPoint(const QualifiedName& tagName, Document* document) 41 41 : HTMLElement(tagName, document) 42 , m_shouldResetStyleInheritance(false) 42 43 { 43 44 } … … 160 161 } 161 162 163 bool InsertionPoint::resetStyleInheritance() const 164 { 165 return m_shouldResetStyleInheritance; 166 } 167 168 void InsertionPoint::setResetStyleInheritance(bool value) 169 { 170 if (value != m_shouldResetStyleInheritance) { 171 m_shouldResetStyleInheritance = value; 172 if (attached() && isActive()) 173 shadowRoot()->host()->setNeedsStyleRecalc(); 174 } 175 } 176 162 177 } // namespace WebCore -
trunk/Source/WebCore/html/shadow/InsertionPoint.h
r130926 r131136 56 56 virtual bool doesSelectFromHostChildren() const = 0; 57 57 58 bool resetStyleInheritance() const; 59 void setResetStyleInheritance(bool); 60 58 61 virtual void attach(); 59 62 virtual void detach(); … … 78 81 private: 79 82 ContentDistribution m_distribution; 83 bool m_shouldResetStyleInheritance : 1; 80 84 }; 81 85
Note: See TracChangeset
for help on using the changeset viewer.