Commit 5836b72a authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

[css-typed-om] Remove unused computed style decl from filtered style map

FilteredComputedStylePropertyMap currently takes a
ComputedStyleDeclaration in its constructor, but doesn't do anything
with it. This patch removes it and moves the node parameter to the front
(makes more sense).

Bug: 785132
Change-Id: I6897004f98bef50df5d1129fd3eacd560e0b6e78
Reviewed-on: https://chromium-review.googlesource.com/790115
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521091}
parent 3738ee85
...@@ -7,10 +7,9 @@ ...@@ -7,10 +7,9 @@
namespace blink { namespace blink {
FilteredComputedStylePropertyMap::FilteredComputedStylePropertyMap( FilteredComputedStylePropertyMap::FilteredComputedStylePropertyMap(
CSSComputedStyleDeclaration* computed_style_declaration, Node* node,
const Vector<CSSPropertyID>& native_properties, const Vector<CSSPropertyID>& native_properties,
const Vector<AtomicString>& custom_properties, const Vector<AtomicString>& custom_properties)
Node* node)
: ComputedStylePropertyMap(node) { : ComputedStylePropertyMap(node) {
for (const auto& native_property : native_properties) { for (const auto& native_property : native_properties) {
native_properties_.insert(native_property); native_properties_.insert(native_property);
......
...@@ -16,22 +16,20 @@ class CORE_EXPORT FilteredComputedStylePropertyMap ...@@ -16,22 +16,20 @@ class CORE_EXPORT FilteredComputedStylePropertyMap
: public ComputedStylePropertyMap { : public ComputedStylePropertyMap {
public: public:
static FilteredComputedStylePropertyMap* Create( static FilteredComputedStylePropertyMap* Create(
CSSComputedStyleDeclaration* computed_style_declaration, Node* node,
const Vector<CSSPropertyID>& native_properties, const Vector<CSSPropertyID>& native_properties,
const Vector<AtomicString>& custom_properties, const Vector<AtomicString>& custom_properties) {
Node* node) { return new FilteredComputedStylePropertyMap(node, native_properties,
return new FilteredComputedStylePropertyMap( custom_properties);
computed_style_declaration, native_properties, custom_properties, node);
} }
Vector<String> getProperties() override; Vector<String> getProperties() override;
private: private:
FilteredComputedStylePropertyMap( FilteredComputedStylePropertyMap(
CSSComputedStyleDeclaration*, Node*,
const Vector<CSSPropertyID>& native_properties, const Vector<CSSPropertyID>& native_properties,
const Vector<AtomicString>& custom_properties, const Vector<AtomicString>& custom_properties);
Node*);
const CSSValue* GetProperty(CSSPropertyID) override; const CSSValue* GetProperty(CSSPropertyID) override;
const CSSValue* GetCustomProperty(AtomicString) override; const CSSValue* GetCustomProperty(AtomicString) override;
......
...@@ -38,20 +38,20 @@ TEST_F(FilteredComputedStylePropertyMapTest, GetProperties) { ...@@ -38,20 +38,20 @@ TEST_F(FilteredComputedStylePropertyMapTest, GetProperties) {
Vector<AtomicString> empty_custom_properties; Vector<AtomicString> empty_custom_properties;
FilteredComputedStylePropertyMap* map = FilteredComputedStylePropertyMap* map =
FilteredComputedStylePropertyMap::Create(Declaration(), native_properties, FilteredComputedStylePropertyMap::Create(PageNode(), native_properties,
custom_properties, PageNode()); custom_properties);
EXPECT_TRUE(map->getProperties().Contains("color")); EXPECT_TRUE(map->getProperties().Contains("color"));
EXPECT_TRUE(map->getProperties().Contains("align-items")); EXPECT_TRUE(map->getProperties().Contains("align-items"));
EXPECT_TRUE(map->getProperties().Contains("--foo")); EXPECT_TRUE(map->getProperties().Contains("--foo"));
EXPECT_TRUE(map->getProperties().Contains("--bar")); EXPECT_TRUE(map->getProperties().Contains("--bar"));
map = FilteredComputedStylePropertyMap::Create( map = FilteredComputedStylePropertyMap::Create(PageNode(), native_properties,
Declaration(), native_properties, empty_custom_properties, PageNode()); empty_custom_properties);
EXPECT_TRUE(map->getProperties().Contains("color")); EXPECT_TRUE(map->getProperties().Contains("color"));
EXPECT_TRUE(map->getProperties().Contains("align-items")); EXPECT_TRUE(map->getProperties().Contains("align-items"));
map = FilteredComputedStylePropertyMap::Create( map = FilteredComputedStylePropertyMap::Create(
Declaration(), empty_native_properties, custom_properties, PageNode()); PageNode(), empty_native_properties, custom_properties);
EXPECT_TRUE(map->getProperties().Contains("--foo")); EXPECT_TRUE(map->getProperties().Contains("--foo"));
EXPECT_TRUE(map->getProperties().Contains("--bar")); EXPECT_TRUE(map->getProperties().Contains("--bar"));
} }
...@@ -61,9 +61,8 @@ TEST_F(FilteredComputedStylePropertyMapTest, NativePropertyAccessors) { ...@@ -61,9 +61,8 @@ TEST_F(FilteredComputedStylePropertyMapTest, NativePropertyAccessors) {
{CSSPropertyColor, CSSPropertyAlignItems}); {CSSPropertyColor, CSSPropertyAlignItems});
Vector<AtomicString> empty_custom_properties; Vector<AtomicString> empty_custom_properties;
FilteredComputedStylePropertyMap* map = FilteredComputedStylePropertyMap* map =
FilteredComputedStylePropertyMap::Create(Declaration(), native_properties, FilteredComputedStylePropertyMap::Create(PageNode(), native_properties,
empty_custom_properties, empty_custom_properties);
PageNode());
DummyExceptionStateForTesting exception_state; DummyExceptionStateForTesting exception_state;
...@@ -93,9 +92,8 @@ TEST_F(FilteredComputedStylePropertyMapTest, CustomPropertyAccessors) { ...@@ -93,9 +92,8 @@ TEST_F(FilteredComputedStylePropertyMapTest, CustomPropertyAccessors) {
Vector<CSSPropertyID> empty_native_properties; Vector<CSSPropertyID> empty_native_properties;
Vector<AtomicString> custom_properties({"--foo", "--bar"}); Vector<AtomicString> custom_properties({"--foo", "--bar"});
FilteredComputedStylePropertyMap* map = FilteredComputedStylePropertyMap* map =
FilteredComputedStylePropertyMap::Create(Declaration(), FilteredComputedStylePropertyMap::Create(
empty_native_properties, PageNode(), empty_native_properties, custom_properties);
custom_properties, PageNode());
DummyExceptionStateForTesting exception_state; DummyExceptionStateForTesting exception_state;
......
...@@ -105,10 +105,9 @@ scoped_refptr<Image> CSSPaintDefinition::Paint( ...@@ -105,10 +105,9 @@ scoped_refptr<Image> CSSPaintDefinition::Paint(
context_settings_, zoom); context_settings_, zoom);
PaintSize* paint_size = PaintSize::Create(specified_size); PaintSize* paint_size = PaintSize::Create(specified_size);
StylePropertyMapReadonly* style_map = StylePropertyMapReadonly* style_map =
FilteredComputedStylePropertyMap::Create( FilteredComputedStylePropertyMap::Create(layout_object.GetNode(),
CSSComputedStyleDeclaration::Create(layout_object.GetNode()), native_invalidation_properties_,
native_invalidation_properties_, custom_invalidation_properties_, custom_invalidation_properties_);
layout_object.GetNode());
v8::Local<v8::Value> argv[] = { v8::Local<v8::Value> argv[] = {
ToV8(rendering_context, script_state_->GetContext()->Global(), isolate), ToV8(rendering_context, script_state_->GetContext()->Global(), isolate),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment