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

Unified Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2200653002: Apply styles to mathML elements having class attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comment Created 4 years, 4 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 | « third_party/WebKit/Source/core/dom/Node.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index 5bc034fe69b6bc638690d634e74029c7670b5ca6..cb3954962fbf04a48be74a4bb182c668304093b4 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -29,6 +29,7 @@
#include "bindings/core/v8/Microtask.h"
#include "bindings/core/v8/V8DOMWrapper.h"
#include "core/HTMLNames.h"
+#include "core/MathMLNames.h"
#include "core/css/CSSSelector.h"
#include "core/css/resolver/StyleResolver.h"
#include "core/dom/AXObjectCache.h"
@@ -1029,6 +1030,19 @@ bool Node::canStartSelection() const
return parent ? parent->canStartSelection() : true;
}
+// StyledElements allow inline style (style="border: 1px"), presentational attributes (ex. color),
+// class names (ex. class="foo bar") and other non-basic styling features. They also control
+// if this element can participate in style sharing.
+//
+// FIXME: The only things that ever go through StyleResolver that aren't StyledElements are
+// PseudoElements and VTTElements. It's possible we can just eliminate all the checks
+// since those elements will never have class names, inline style, or other things that
+// this apparently guards against.
+bool Node::isStyledElement() const
+{
+ return isHTMLElement() || isSVGElement() || (isElementNode() && toElement(this)->namespaceURI() == MathMLNames::mathmlNamespaceURI);
+}
+
bool Node::canParticipateInFlatTree() const
{
return !isShadowRoot() && !isSlotOrActiveInsertionPoint();
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698