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

Unified Diff: WebCore/css/CSSStyleSheet.cpp

Issue 6474050: Revert 78101 - Merge r76728, crbug 68263 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 9 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 | « WebCore/css/CSSStyleSheet.h ('k') | WebCore/xml/XSLStyleSheet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/css/CSSStyleSheet.cpp
===================================================================
--- WebCore/css/CSSStyleSheet.cpp (revision 78365)
+++ WebCore/css/CSSStyleSheet.cpp (working copy)
@@ -53,6 +53,7 @@
CSSStyleSheet::CSSStyleSheet(CSSStyleSheet* parentSheet, const String& href, const KURL& baseURL, const String& charset)
: StyleSheet(parentSheet, href, baseURL)
+ , m_document(parentSheet ? parentSheet->document() : 0)
, m_charset(charset)
, m_loadCompleted(false)
, m_strictParsing(!parentSheet || parentSheet->useStrictParsing())
@@ -63,6 +64,7 @@
CSSStyleSheet::CSSStyleSheet(Node* parentNode, const String& href, const KURL& baseURL, const String& charset)
: StyleSheet(parentNode, href, baseURL)
+ , m_document(parentNode->document())
, m_charset(charset)
, m_loadCompleted(false)
, m_strictParsing(false)
@@ -80,6 +82,7 @@
, m_hasSyntacticallyValidCSSHeader(true)
{
CSSStyleSheet* parentSheet = ownerRule ? ownerRule->parentStyleSheet() : 0;
+ m_document = parentSheet ? parentSheet->document() : 0;
m_isUserStyleSheet = parentSheet ? parentSheet->isUserStyleSheet() : false;
}
@@ -230,24 +233,6 @@
m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true;
}
-Document* CSSStyleSheet::document()
-{
- StyleBase* styleObject = this;
- while (styleObject) {
- if (styleObject->isCSSStyleSheet()) {
- Node* ownerNode = static_cast<CSSStyleSheet*>(styleObject)->ownerNode();
- if (ownerNode)
- return ownerNode->document();
- }
- if (styleObject->isRule())
- styleObject = static_cast<CSSRule*>(styleObject)->parentStyleSheet();
- else
- styleObject = styleObject->parent();
- }
-
- return 0;
-}
-
void CSSStyleSheet::styleSheetChanged()
{
StyleBase* root = this;
« no previous file with comments | « WebCore/css/CSSStyleSheet.h ('k') | WebCore/xml/XSLStyleSheet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698