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

Unified Diff: sky/engine/core/html/HTMLStyleElement.cpp

Issue 788113002: Simplify HTMLStyleElement. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/html/HTMLStyleElement.h ('k') | sky/engine/core/html/HTMLTagNames.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/html/HTMLStyleElement.cpp
diff --git a/sky/engine/core/html/HTMLStyleElement.cpp b/sky/engine/core/html/HTMLStyleElement.cpp
index e8ab1d70469747721eacbbe65f39e91b4fbd2c2a..6942b9ee5968b8b889743e718251f6f77347503a 100644
--- a/sky/engine/core/html/HTMLStyleElement.cpp
+++ b/sky/engine/core/html/HTMLStyleElement.cpp
@@ -36,15 +36,11 @@
namespace blink {
-inline HTMLStyleElement::HTMLStyleElement(Document& document, bool createdByParser)
+inline HTMLStyleElement::HTMLStyleElement(Document& document)
: HTMLElement(HTMLNames::styleTag, document)
- , m_createdByParser(createdByParser)
, m_loading(false)
, m_registeredAsCandidate(false)
- , m_startPosition(TextPosition::belowRangePosition())
{
- if (createdByParser)
- m_startPosition = document.parserPosition();
}
HTMLStyleElement::~HTMLStyleElement()
@@ -54,9 +50,9 @@ HTMLStyleElement::~HTMLStyleElement()
clearSheet();
}
-PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(Document& document, bool createdByParser)
+PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(Document& document)
{
- return adoptRef(new HTMLStyleElement(document, createdByParser));
+ return adoptRef(new HTMLStyleElement(document));
}
void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -69,12 +65,6 @@ void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr
}
}
-void HTMLStyleElement::finishParsingChildren()
-{
- process();
- m_createdByParser = false;
-}
-
void HTMLStyleElement::insertedInto(ContainerNode* insertionPoint)
{
HTMLElement::insertedInto(insertionPoint);
@@ -121,9 +111,6 @@ void HTMLStyleElement::removedFrom(ContainerNode* insertionPoint)
void HTMLStyleElement::childrenChanged(const ChildrenChange& change)
{
HTMLElement::childrenChanged(change);
-
- if (m_createdByParser)
- return;
process();
}
@@ -177,8 +164,7 @@ void HTMLStyleElement::createSheet()
if (screenEval.eval(mediaQueries.get()) || printEval.eval(mediaQueries.get())) {
m_loading = true;
const String& text = textFromChildren();
- TextPosition startPosition = m_startPosition == TextPosition::belowRangePosition() ? TextPosition::minimumPosition() : m_startPosition;
- m_sheet = document().styleEngine()->createSheet(this, text, startPosition, m_createdByParser);
+ m_sheet = document().styleEngine()->createSheet(this, text);
m_sheet->setMediaQueries(mediaQueries.release());
m_loading = false;
}
@@ -206,10 +192,7 @@ void HTMLStyleElement::processStyleSheet()
ASSERT(inDocument());
m_registeredAsCandidate = true;
- document().styleEngine()->addStyleSheetCandidateNode(this, m_createdByParser);
- if (m_createdByParser)
- return;
-
+ document().styleEngine()->addStyleSheetCandidateNode(this, false);
process();
}
« no previous file with comments | « sky/engine/core/html/HTMLStyleElement.h ('k') | sky/engine/core/html/HTMLTagNames.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698