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

Unified Diff: third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h

Issue 2403423002: [CSSTypedOM] Computed StylePropertyMap use ComputedStyle for Lengths (Closed)
Patch Set: Use StyleValueFactory & ComputedStyleCSSValueMapping for unsupported Created 3 years, 11 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/css/cssom/ComputedStylePropertyMap.h
diff --git a/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h b/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h
index 0475e698c82fb508c696a6440ef0fdc8f7606aee..6fb8e019a2fa6842dd0c2c3e4476f6672473a9d4 100644
--- a/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h
+++ b/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h
@@ -7,6 +7,8 @@
#include "core/css/CSSComputedStyleDeclaration.h"
#include "core/css/cssom/ImmutableStylePropertyMap.h"
+#include "core/dom/Node.h"
+#include "core/layout/LayoutObject.h"
namespace blink {
@@ -14,23 +16,29 @@ class CORE_EXPORT ComputedStylePropertyMap : public ImmutableStylePropertyMap {
WTF_MAKE_NONCOPYABLE(ComputedStylePropertyMap);
public:
- static ComputedStylePropertyMap* create(
- CSSComputedStyleDeclaration* computedStyleDeclaration) {
- return new ComputedStylePropertyMap(computedStyleDeclaration);
+ static ComputedStylePropertyMap* create(Node* node,
+ const String& pseudoElement) {
+ return new ComputedStylePropertyMap(node, pseudoElement);
}
Vector<String> getProperties() override;
DEFINE_INLINE_VIRTUAL_TRACE() {
visitor->trace(m_computedStyleDeclaration);
+ visitor->trace(m_node);
ImmutableStylePropertyMap::trace(visitor);
}
+ private:
+ Node* node() const;
+
protected:
- ComputedStylePropertyMap(
- CSSComputedStyleDeclaration* computedStyleDeclaration)
+ ComputedStylePropertyMap(Node* node, const String& pseudoElement = String())
: ImmutableStylePropertyMap(),
- m_computedStyleDeclaration(computedStyleDeclaration) {}
+ m_computedStyleDeclaration(
+ CSSComputedStyleDeclaration::create(node, false, pseudoElement)),
+ m_pseudoId(CSSSelector::parsePseudoId(pseudoElement)),
+ m_node(node) {}
CSSStyleValueVector getAllInternal(CSSPropertyID) override;
CSSStyleValueVector getAllInternal(AtomicString customPropertyName) override;
@@ -39,7 +47,9 @@ class CORE_EXPORT ComputedStylePropertyMap : public ImmutableStylePropertyMap {
return HeapVector<StylePropertyMapEntry>();
}
- Member<CSSStyleDeclaration> m_computedStyleDeclaration;
+ Member<CSSComputedStyleDeclaration> m_computedStyleDeclaration;
+ PseudoId m_pseudoId;
+ Member<Node> m_node;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698