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

Unified Diff: sky/engine/core/dom/Element.cpp

Issue 709573002: Remove custom style callbacks. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Element.cpp
diff --git a/sky/engine/core/dom/Element.cpp b/sky/engine/core/dom/Element.cpp
index 7ed41225758bf351df7cc1b287dccd6d15d878d8..f0b3e53e048700d694e3c2d157f9b688d0241196 100644
--- a/sky/engine/core/dom/Element.cpp
+++ b/sky/engine/core/dom/Element.cpp
@@ -902,17 +902,12 @@ PassRefPtr<RenderStyle> Element::styleForRenderer()
{
ASSERT(document().inStyleRecalc());
- RefPtr<RenderStyle> style;
-
// FIXME: Instead of clearing updates that may have been added from calls to styleForElement
// outside recalcStyle, we should just never set them if we're not inside recalcStyle.
if (ActiveAnimations* activeAnimations = this->activeAnimations())
activeAnimations->cssAnimations().setPendingUpdate(nullptr);
- if (hasCustomStyleCallbacks())
- style = customStyleForRenderer();
- if (!style)
- style = originalStyleForRenderer();
+ RefPtr<RenderStyle> style = document().ensureStyleResolver().styleForElement(this);
ASSERT(style);
// styleForElement() might add active animations so we need to get it again.
@@ -930,19 +925,13 @@ PassRefPtr<RenderStyle> Element::styleForRenderer()
return style.release();
}
-PassRefPtr<RenderStyle> Element::originalStyleForRenderer()
-{
- ASSERT(document().inStyleRecalc());
- return document().ensureStyleResolver().styleForElement(this);
-}
-
void Element::recalcStyle(StyleRecalcChange change, Text* nextTextSibling)
{
ASSERT(document().inStyleRecalc());
ASSERT(!parentOrShadowHostNode()->needsStyleRecalc());
- if (hasCustomStyleCallbacks())
- willRecalcStyle(change);
+ if (isInsertionPoint())
+ toInsertionPoint(this)->willRecalcStyle(change);
if (change >= Inherit || needsStyleRecalc()) {
if (hasRareData()) {
@@ -965,9 +954,6 @@ void Element::recalcStyle(StyleRecalcChange change, Text* nextTextSibling)
clearChildNeedsStyleRecalc();
}
- if (hasCustomStyleCallbacks())
- didRecalcStyle(change);
-
if (change == Reattach)
reattachWhitespaceSiblings(nextTextSibling);
}
@@ -1673,23 +1659,6 @@ void Element::setSavedLayerScrollOffset(const IntSize& size)
ensureElementRareData().setSavedLayerScrollOffset(size);
}
-void Element::willRecalcStyle(StyleRecalcChange)
-{
- ASSERT(hasCustomStyleCallbacks());
-}
-
-void Element::didRecalcStyle(StyleRecalcChange)
-{
- ASSERT(hasCustomStyleCallbacks());
-}
-
-
-PassRefPtr<RenderStyle> Element::customStyleForRenderer()
-{
- ASSERT(hasCustomStyleCallbacks());
- return nullptr;
-}
-
void Element::cloneAttributesFromElement(const Element& other)
{
other.synchronizeAllAttributes();
« no previous file with comments | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698