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

Side by Side Diff: Source/core/dom/Element.cpp

Issue 30453002: Should not allow style sharing if grandparents matches different rule chain (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@build_hack
Patch Set: reupload Created 7 years, 2 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/css/style-sharing-grand-parent-invalidate-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 } 1571 }
1572 1572
1573 InspectorInstrumentation::didRecalculateStyleForElement(this); 1573 InspectorInstrumentation::didRecalculateStyleForElement(this);
1574 1574
1575 if (localChange != NoChange && callbackSelectorsDiffer(oldStyle.get(), newSt yle.get())) 1575 if (localChange != NoChange && callbackSelectorsDiffer(oldStyle.get(), newSt yle.get()))
1576 updateCallbackSelectors(oldStyle.get(), newStyle.get()); 1576 updateCallbackSelectors(oldStyle.get(), newStyle.get());
1577 1577
1578 if (RenderObject* renderer = this->renderer()) { 1578 if (RenderObject* renderer = this->renderer()) {
1579 if (localChange != NoChange || pseudoStyleCacheIsInvalid(oldStyle.get(), newStyle.get()) || (change == Force && renderer->requiresForcedStyleRecalcPropa gation()) || shouldNotifyRendererWithIdenticalStyles()) { 1579 if (localChange != NoChange || pseudoStyleCacheIsInvalid(oldStyle.get(), newStyle.get()) || (change == Force && renderer->requiresForcedStyleRecalcPropa gation()) || shouldNotifyRendererWithIdenticalStyles()) {
1580 renderer->setAnimatableStyle(newStyle.get()); 1580 renderer->setAnimatableStyle(newStyle.get());
1581 } else if (needsStyleRecalc()) { 1581 } else {
1582 // Although no change occurred, we use the new style so that the cou sin style sharing code won't get 1582 // Although no change occurred, we use the new style so that the cou sin style sharing code won't get
1583 // fooled into believing this style is the same. 1583 // fooled into believing this style is the same.
1584 // FIXME: We may be able to remove this hack, see discussion in
1585 // https://codereview.chromium.org/30453002/
1584 renderer->setStyleInternal(newStyle.get()); 1586 renderer->setStyleInternal(newStyle.get());
1585 } 1587 }
1586 } 1588 }
1587 1589
1588 // If "rem" units are used anywhere in the document, and if the document ele ment's font size changes, then go ahead and force font updating 1590 // If "rem" units are used anywhere in the document, and if the document ele ment's font size changes, then go ahead and force font updating
1589 // all the way down the tree. This is simpler than having to maintain a cach e of objects (and such font size changes should be rare anyway). 1591 // all the way down the tree. This is simpler than having to maintain a cach e of objects (and such font size changes should be rare anyway).
1590 if (document().styleEngine()->usesRemUnits() && document().documentElement() == this && oldStyle && newStyle && oldStyle->fontSize() != newStyle->fontSize() ) { 1592 if (document().styleEngine()->usesRemUnits() && document().documentElement() == this && oldStyle && newStyle && oldStyle->fontSize() != newStyle->fontSize() ) {
1591 // Cached RenderStyles may depend on the re units. 1593 // Cached RenderStyles may depend on the re units.
1592 document().styleResolver()->invalidateMatchedPropertiesCache(); 1594 document().styleResolver()->invalidateMatchedPropertiesCache();
1593 return Force; 1595 return Force;
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after
3631 return 0; 3633 return 0;
3632 } 3634 }
3633 3635
3634 Attribute* UniqueElementData::attributeItem(unsigned index) 3636 Attribute* UniqueElementData::attributeItem(unsigned index)
3635 { 3637 {
3636 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3638 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3637 return &m_attributeVector.at(index); 3639 return &m_attributeVector.at(index);
3638 } 3640 }
3639 3641
3640 } // namespace WebCore 3642 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/style-sharing-grand-parent-invalidate-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698