Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Unified Diff: Source/WebCore/css/StyleResolver.cpp

Issue 12209019: Merge 141093 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | Source/WebCore/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/css/StyleResolver.cpp
===================================================================
--- Source/WebCore/css/StyleResolver.cpp (revision 141894)
+++ Source/WebCore/css/StyleResolver.cpp (working copy)
@@ -1000,6 +1000,13 @@
static const unsigned cStyleSearchThreshold = 10;
static const unsigned cStyleSearchLevelThreshold = 10;
+static inline bool parentElementPreventsSharing(const Element* parentElement)
+{
+ if (!parentElement)
+ return false;
+ return parentElement->hasFlagsSetDuringStylingOfChildren();
+}
+
Node* StyleResolver::locateCousinList(Element* parent, unsigned& visitedNodeCount) const
{
if (visitedNodeCount >= cStyleSearchThreshold * cStyleSearchLevelThreshold)
@@ -1029,7 +1036,8 @@
while (thisCousin) {
while (currentNode) {
++subcount;
- if (currentNode->renderStyle() == parentStyle && currentNode->lastChild()) {
+ if (currentNode->renderStyle() == parentStyle && currentNode->lastChild()
+ && currentNode->isElementNode() && !parentElementPreventsSharing(toElement(currentNode))) {
// Adjust for unused reserved tries.
visitedNodeCount -= cStyleSearchThreshold - subcount;
return currentNode->lastChild();
@@ -1248,16 +1256,6 @@
return static_cast<StyledElement*>(node);
}
-static inline bool parentElementPreventsSharing(const Element* parentElement)
-{
- if (!parentElement)
- return false;
- return parentElement->childrenAffectedByPositionalRules()
- || parentElement->childrenAffectedByFirstChildRules()
- || parentElement->childrenAffectedByLastChildRules()
- || parentElement->childrenAffectedByDirectAdjacentRules();
-}
-
RenderStyle* StyleResolver::locateSharedStyle()
{
if (!m_styledElement || !m_parentStyle)
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | Source/WebCore/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698