Changeset 119949 in webkit
- Timestamp:
- Jun 10, 2012 8:58:56 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r119948 r119949 1 2012-06-10 Hayato Ito <hayato@chromium.org> 2 3 An inheritance of '-webkit-user-modify' does not stop at shadow boundary. 4 https://bugs.webkit.org/show_bug.cgi?id=88514 5 6 Reviewed by Ryosuke Niwa. 7 8 * fast/dom/shadow/user-modify-inheritance-expected.txt: Added. 9 * fast/dom/shadow/user-modify-inheritance.html: Added. 10 1 11 2012-06-10 Yoshifumi Inoue <yosin@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r119948 r119949 1 2012-06-10 Hayato Ito <hayato@chromium.org> 2 3 An inheritance of '-webkit-user-modify' does not stop at shadow boundary. 4 https://bugs.webkit.org/show_bug.cgi?id=88514 5 6 Reviewed by Ryosuke Niwa. 7 8 In StyleResolver::styleForElement(), we reset '-webkit-user-modify' 9 CSS property after inheriting a parent style, but that is not 10 enough. We also have to reset '-webkit-user-modify' when we use a 11 cached result in applying matched properties. 12 13 Test: fast/dom/shadow/user-modify-inheritance.html 14 15 * css/StyleResolver.cpp: 16 (WebCore::StyleResolver::applyMatchedProperties): 17 (WebCore::StyleResolver::styleForElement): 18 * css/StyleResolver.h: 19 (StyleResolver): 20 * rendering/style/RenderStyle.cpp: 21 (WebCore::RenderStyle::inheritFrom): 22 * rendering/style/RenderStyle.h: 23 1 24 2012-06-10 Yoshifumi Inoue <yosin@chromium.org> 2 25 -
trunk/Source/WebCore/css/StyleResolver.cpp
r119799 r119949 1620 1620 } 1621 1621 1622 static inline bool isAtShadowBoundary( Element* element)1622 static inline bool isAtShadowBoundary(const Element* element) 1623 1623 { 1624 1624 if (!element) … … 1655 1655 1656 1656 if (m_parentStyle) 1657 m_style->inheritFrom(m_parentStyle );1657 m_style->inheritFrom(m_parentStyle, isAtShadowBoundary(element) ? RenderStyle::AtShadowBoundary : RenderStyle::NotAtShadowBoundary); 1658 1658 else { 1659 1659 m_parentStyle = style(); … … 1666 1666 } 1667 1667 1668 // Even if surrounding content is user-editable, shadow DOM should act as a single unit, and not necessarily be editable1669 if (isAtShadowBoundary(element))1670 m_style->setUserModify(RenderStyle::initialUserModify());1671 1672 1668 if (element->isLink()) { 1673 1669 m_style->setIsLink(true); … … 1683 1679 matchAllRules(matchResult, matchingBehavior != MatchAllRulesExcludingSMIL); 1684 1680 1685 applyMatchedProperties(matchResult );1681 applyMatchedProperties(matchResult, element); 1686 1682 1687 1683 // Clean up our style object's display and text decorations (among other fixups). … … 1844 1840 m_style->setStyleType(pseudo); 1845 1841 1846 applyMatchedProperties(matchResult );1842 applyMatchedProperties(matchResult, e); 1847 1843 1848 1844 // Clean up our style object's display and text decorations (among other fixups). … … 2824 2820 } 2825 2821 2826 void StyleResolver::applyMatchedProperties(const MatchResult& matchResult) 2827 { 2822 void StyleResolver::applyMatchedProperties(const MatchResult& matchResult, const Element* element) 2823 { 2824 ASSERT(element); 2828 2825 unsigned cacheHash = matchResult.isCacheable ? computeMatchedPropertiesHash(matchResult.matchedProperties.data(), matchResult.matchedProperties.size()) : 0; 2829 2826 bool applyInheritedOnly = false; … … 2838 2835 // If the cache item parent style has identical inherited properties to the current parent style then the 2839 2836 // resulting style will be identical too. We copy the inherited properties over from the cache and are done. 2840 m_style->inheritFrom(cacheItem->renderStyle.get() );2837 m_style->inheritFrom(cacheItem->renderStyle.get(), isAtShadowBoundary(element) ? RenderStyle::AtShadowBoundary : RenderStyle::NotAtShadowBoundary); 2841 2838 // Unfortunately the link status is treated like an inherited property. We need to explicitly restore it. 2842 2839 m_style->setInsideLink(linkStatus); -
trunk/Source/WebCore/css/StyleResolver.h
r119799 r119949 354 354 bool checkSelector(const RuleData&, const ContainerNode* scope = 0); 355 355 bool checkRegionSelector(CSSSelector* regionSelector, Element* regionElement); 356 void applyMatchedProperties(const MatchResult& );356 void applyMatchedProperties(const MatchResult&, const Element*); 357 357 enum StyleApplicationPass { 358 358 HighPriorityProperties, -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r119564 r119949 163 163 } 164 164 165 void RenderStyle::inheritFrom(const RenderStyle* inheritParent) 166 { 167 rareInheritedData = inheritParent->rareInheritedData; 165 void RenderStyle::inheritFrom(const RenderStyle* inheritParent, IsAtShadowBoundary isAtShadowBoundary) 166 { 167 if (isAtShadowBoundary == AtShadowBoundary) { 168 // Even if surrounding content is user-editable, shadow DOM should act as a single unit, and not necessarily be editable 169 EUserModify currentUserModify = userModify(); 170 rareInheritedData = inheritParent->rareInheritedData; 171 setUserModify(currentUserModify); 172 } else 173 rareInheritedData = inheritParent->rareInheritedData; 168 174 inherited = inheritParent->inherited; 169 175 inherited_flags = inheritParent->inherited_flags; -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r119455 r119949 391 391 static PassRefPtr<RenderStyle> clone(const RenderStyle*); 392 392 393 void inheritFrom(const RenderStyle* inheritParent); 393 enum IsAtShadowBoundary { 394 AtShadowBoundary, 395 NotAtShadowBoundary, 396 }; 397 398 void inheritFrom(const RenderStyle* inheritParent, IsAtShadowBoundary = NotAtShadowBoundary); 394 399 void copyNonInheritedFrom(const RenderStyle*); 395 400
Note: See TracChangeset
for help on using the changeset viewer.