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

Unified Diff: third_party/WebKit/Source/core/dom/NodeComputedStyle.h

Issue 2450093005: Support display: contents for elements, first-line and first-letter pseudos. (Closed)
Patch Set: Support display: contents for elements, first-line and first-letter pseudos. Created 3 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
Index: third_party/WebKit/Source/core/dom/NodeComputedStyle.h
diff --git a/third_party/WebKit/Source/core/dom/NodeComputedStyle.h b/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
index 421a88ad33eb5121e57411abf5e2e0b99f458000..ea9a610c3a3fc8a3fde01aa954d2305c998667e0 100644
--- a/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
+++ b/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
@@ -25,6 +25,7 @@
#ifndef NodeComputedStyle_h
#define NodeComputedStyle_h
+#include "core/dom/Element.h"
#include "core/dom/LayoutTreeBuilderTraversal.h"
#include "core/dom/Node.h"
#include "core/dom/shadow/InsertionPoint.h"
@@ -40,12 +41,10 @@ inline const ComputedStyle* Node::computedStyle() const {
inline ComputedStyle* Node::mutableComputedStyle() const {
if (LayoutObject* layoutObject = this->layoutObject())
return layoutObject->mutableStyle();
- // <option> and <optgroup> can be styled even if they don't get layout
- // objects, so they store their style internally and return it through
- // nonLayoutObjectComputedStyle(). We check here explicitly to avoid the
- // virtual call in the common case.
- if (isHTMLOptGroupElement(*this) || isHTMLOptionElement(this))
- return nonLayoutObjectComputedStyle();
+
+ if (isElementNode())
+ return toElement(this)->mutableNonLayoutObjectComputedStyle();
+
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698