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

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 19525002: Pause SVG animations when the document is detached. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove defaultStyleForElement branch as well Created 7 years, 5 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 | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 0a4d9222ef87a58b8e6d996013038cae0141aaaf..bbdc4f530f98f14910e40d998b8dd93f5af3ec19 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -612,10 +612,8 @@ static inline void resetDirectionAndWritingModeOnDocument(Document* document)
PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderStyle* defaultParent, StyleSharingBehavior sharingBehavior,
RuleMatchingBehavior matchingBehavior, RenderRegion* regionForStyling)
{
- // FIXME: We should only ever resolve style on documents which are
- // in a frame. Unfortunately SVG Animation violates this: crbug.com/260966
- // ASSERT(document()->frame());
- // ASSERT(documentSettings());
+ ASSERT(document()->frame());
+ ASSERT(documentSettings());
// Once an element has a renderer, we don't try to destroy it, since otherwise the renderer
// will vanish if a style recalc happens during loading.
@@ -935,12 +933,6 @@ PassRefPtr<RenderStyle> StyleResolver::styleForPage(int pageIndex)
PassRefPtr<RenderStyle> StyleResolver::defaultStyleForElement()
{
m_state.setStyle(RenderStyle::create());
- // FIXME: This should be removed once SVG Animations are fixed
- // to not resolve style on documents outside a frame: crbug.com/260966
- if (!documentSettings()) {
- m_state.style()->font().update(0);
- return m_state.takeStyle();
- }
m_state.fontBuilder().initForStyleResolve(document(), m_state.style(), m_state.useSVGZoomRules());
m_state.style()->setLineHeight(RenderStyle::initialLineHeight());
m_state.setLineHeightValue(0);
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698