Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
| diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
| index b3c917b9ea20dae8bd7d356dd2a94992139c974b..a7e9f24fc2557873823cd346f06ad1c513657eb6 100644 |
| --- a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
| +++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
| @@ -69,17 +69,16 @@ private: |
| }; |
| #if DCHECK_IS_ON() |
| -static bool isAcceptableCSSStyleSheetParent(Node* parentNode) |
| +static bool isAcceptableCSSStyleSheetParent(const Node& parentNode) |
| { |
| // Only these nodes can be parents of StyleSheets, and they need to call |
| // clearOwnerNode() when moved out of document. Note that destructor of |
| // the nodes don't call clearOwnerNode() with Oilpan. |
| - return !parentNode |
| - || parentNode->isDocumentNode() |
| - || isHTMLLinkElement(*parentNode) |
| - || isHTMLStyleElement(*parentNode) |
| - || isSVGStyleElement(*parentNode) |
| - || parentNode->getNodeType() == Node::kProcessingInstructionNode; |
| + return parentNode.isDocumentNode() |
| + || isHTMLLinkElement(parentNode) |
| + || isHTMLStyleElement(parentNode) |
| + || isSVGStyleElement(parentNode) |
| + || parentNode.getNodeType() == Node::kProcessingInstructionNode; |
| } |
| #endif |
| @@ -88,20 +87,20 @@ CSSStyleSheet* CSSStyleSheet::create(StyleSheetContents* sheet, CSSImportRule* o |
| return new CSSStyleSheet(sheet, ownerRule); |
| } |
| -CSSStyleSheet* CSSStyleSheet::create(StyleSheetContents* sheet, Node* ownerNode) |
| +CSSStyleSheet* CSSStyleSheet::create(StyleSheetContents* sheet, Node& ownerNode) |
| { |
| return new CSSStyleSheet(sheet, ownerNode, false, TextPosition::minimumPosition()); |
| } |
| -CSSStyleSheet* CSSStyleSheet::createInline(StyleSheetContents* sheet, Node* ownerNode, const TextPosition& startPosition) |
| +CSSStyleSheet* CSSStyleSheet::createInline(StyleSheetContents* sheet, Node& ownerNode, const TextPosition& startPosition) |
| { |
| DCHECK(sheet); |
| return new CSSStyleSheet(sheet, ownerNode, true, startPosition); |
| } |
| -CSSStyleSheet* CSSStyleSheet::createInline(Node* ownerNode, const KURL& baseURL, const TextPosition& startPosition, const String& encoding) |
| +CSSStyleSheet* CSSStyleSheet::createInline(Node& ownerNode, const KURL& baseURL, const TextPosition& startPosition, const String& encoding) |
| { |
| - CSSParserContext parserContext(ownerNode->document(), nullptr, baseURL, encoding); |
| + CSSParserContext parserContext(ownerNode.document(), nullptr, baseURL, encoding); |
| StyleSheetContents* sheet = StyleSheetContents::create(baseURL.getString(), parserContext); |
| return new CSSStyleSheet(sheet, ownerNode, true, startPosition); |
| } |
| @@ -118,11 +117,11 @@ CSSStyleSheet::CSSStyleSheet(StyleSheetContents* contents, CSSImportRule* ownerR |
| m_contents->registerClient(this); |
| } |
| -CSSStyleSheet::CSSStyleSheet(StyleSheetContents* contents, Node* ownerNode, bool isInlineStylesheet, const TextPosition& startPosition) |
| +CSSStyleSheet::CSSStyleSheet(StyleSheetContents* contents, Node& ownerNode, bool isInlineStylesheet, const TextPosition& startPosition) |
| : m_contents(contents) |
| , m_isInlineStylesheet(isInlineStylesheet) |
| , m_isDisabled(false) |
| - , m_ownerNode(ownerNode) |
| + , m_ownerNode(&ownerNode) |
|
sashab
2016/09/21 01:33:29
Might be a stretch but... Can we make m_ownerNode
rune
2016/09/21 07:17:45
m_ownerNode is nullptr for @import stylesheets. It
|
| , m_ownerRule(nullptr) |
| , m_startPosition(startPosition) |
| , m_loadCompleted(false) |