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

Side by Side Diff: sky/engine/core/dom/Element.cpp

Issue 712423002: Simplify some parsing-related code (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « sky/engine/core/dom/DocumentParser.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 inlineStyle = BisonCSSParser::parseInlineStyleDeclaration(newStyleString , this); 1711 inlineStyle = BisonCSSParser::parseInlineStyleDeclaration(newStyleString , this);
1712 } else { 1712 } else {
1713 ASSERT(inlineStyle->isMutable()); 1713 ASSERT(inlineStyle->isMutable());
1714 static_cast<MutableStylePropertySet*>(inlineStyle.get())->parseDeclarati on(newStyleString, document().elementSheet().contents()); 1714 static_cast<MutableStylePropertySet*>(inlineStyle.get())->parseDeclarati on(newStyleString, document().elementSheet().contents());
1715 } 1715 }
1716 } 1716 }
1717 1717
1718 void Element::styleAttributeChanged(const AtomicString& newStyleString) 1718 void Element::styleAttributeChanged(const AtomicString& newStyleString)
1719 { 1719 {
1720 ASSERT(isStyledElement()); 1720 ASSERT(isStyledElement());
1721 WTF::OrdinalNumber startLineNumber = WTF::OrdinalNumber::beforeFirst();
1722 if (document().scriptableDocumentParser())
1723 startLineNumber = document().scriptableDocumentParser()->lineNumber();
esprehn 2014/11/11 17:53:39 CSP!!
1724 1721
1725 if (newStyleString.isNull()) { 1722 if (newStyleString.isNull()) {
1726 ensureUniqueElementData().m_inlineStyle.clear(); 1723 ensureUniqueElementData().m_inlineStyle.clear();
1727 } else { 1724 } else {
1728 setInlineStyleFromString(newStyleString); 1725 setInlineStyleFromString(newStyleString);
1729 } 1726 }
1730 1727
1731 elementData()->m_styleAttributeIsDirty = false; 1728 elementData()->m_styleAttributeIsDirty = false;
1732 1729
1733 setNeedsStyleRecalc(LocalStyleChange); 1730 setNeedsStyleRecalc(LocalStyleChange);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 return false; 1802 return false;
1806 // Turn off style sharing for elements that can gain layers for reasons outs ide of the style system. 1803 // Turn off style sharing for elements that can gain layers for reasons outs ide of the style system.
1807 // See comments in RenderObject::setStyle(). 1804 // See comments in RenderObject::setStyle().
1808 // FIXME: Why does gaining a layer from outside the style system require dis abling sharing? 1805 // FIXME: Why does gaining a layer from outside the style system require dis abling sharing?
1809 if (isHTMLCanvasElement(*this)) 1806 if (isHTMLCanvasElement(*this))
1810 return false; 1807 return false;
1811 return true; 1808 return true;
1812 } 1809 }
1813 1810
1814 } // namespace blink 1811 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/DocumentParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698