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

Unified Diff: sky/engine/core/css/CSSStyleSheet.cpp

Issue 778743003: Merge StyleSheet into CSSStyleSheet. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: sort headers. Created 6 years 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/css/CSSStyleSheet.h ('k') | sky/engine/core/css/StyleSheet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/CSSStyleSheet.cpp
diff --git a/sky/engine/core/css/CSSStyleSheet.cpp b/sky/engine/core/css/CSSStyleSheet.cpp
index 62dc97ea88e526e2f0133b69751e4ecf9295187b..55e964d983426ee0572f5873c6155d41e367be8d 100644
--- a/sky/engine/core/css/CSSStyleSheet.cpp
+++ b/sky/engine/core/css/CSSStyleSheet.cpp
@@ -21,19 +21,11 @@
#include "sky/engine/config.h"
#include "sky/engine/core/css/CSSStyleSheet.h"
-#include "sky/engine/bindings/core/v8/ExceptionState.h"
-#include "sky/engine/bindings/core/v8/V8Binding.h"
-#include "sky/engine/bindings/core/v8/V8PerIsolateData.h"
#include "sky/engine/core/css/MediaList.h"
-#include "sky/engine/core/css/StyleRule.h"
#include "sky/engine/core/css/StyleSheetContents.h"
-#include "sky/engine/core/css/parser/BisonCSSParser.h"
#include "sky/engine/core/dom/Document.h"
-#include "sky/engine/core/dom/ExceptionCode.h"
#include "sky/engine/core/dom/Node.h"
-#include "sky/engine/core/frame/UseCounter.h"
#include "sky/engine/core/html/HTMLStyleElement.h"
-#include "sky/engine/wtf/text/StringBuilder.h"
namespace blink {
@@ -88,45 +80,6 @@ CSSStyleSheet::~CSSStyleSheet()
m_contents->unregisterClient(this);
}
-void CSSStyleSheet::willMutateRules()
-{
- // If we are the only client it is safe to mutate.
- if (m_contents->clientSize() <= 1 && !m_contents->isInMemoryCache()) {
- m_contents->clearRuleSet();
- if (Document* document = ownerDocument())
- m_contents->removeSheetFromCache(document);
- m_contents->setMutable();
- return;
- }
- // Only cacheable stylesheets should have multiple clients.
- ASSERT(m_contents->isCacheable());
-
- // Copy-on-write.
- m_contents->unregisterClient(this);
- m_contents = m_contents->copy();
- m_contents->registerClient(this);
-
- m_contents->setMutable();
-}
-
-void CSSStyleSheet::didMutateRules()
-{
- ASSERT(m_contents->isMutable());
- ASSERT(m_contents->clientSize() <= 1);
-
- didMutate(PartialRuleUpdate);
-}
-
-void CSSStyleSheet::didMutate(StyleSheetUpdateType updateType)
-{
- Document* owner = ownerDocument();
- if (!owner)
- return;
-
- owner->modifiedStyleSheet(this);
-}
-
-
void CSSStyleSheet::setMediaQueries(PassRefPtr<MediaQuerySet> mediaQueries)
{
m_mediaQueries = mediaQueries;
@@ -142,7 +95,8 @@ unsigned CSSStyleSheet::length() const
void CSSStyleSheet::clearOwnerNode()
{
- didMutate(EntireStyleSheetUpdate);
+ if (Document* owner = ownerDocument())
+ owner->modifiedStyleSheet(this);
if (m_ownerNode)
m_contents->unregisterClient(this);
m_ownerNode = nullptr;
« no previous file with comments | « sky/engine/core/css/CSSStyleSheet.h ('k') | sky/engine/core/css/StyleSheet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698