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

Issue 1405293012: [Variables] Enable get/setProperty and similar APIs from the CSSOM (Closed)

Created:
5 years, 1 month ago by leviw_travelin_and_unemployed
Modified:
5 years ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-css, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, dstockwell, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Variables] Enable get/setProperty and similar APIs from the CSSOM Add support for custom properties to the rule property set OM. My approach adds an extra "if" to many of the standard code paths in the interest of avoiding unnecessary code duplication, but if we're really worried about performance, this could be changed. There are clearly still parts of the code that assumes a property ID should be enough to lookup an arbitrary property. These will have to be burned down, but in the meantime I short-circuited findCSSPropertyWithID for the custom property case. BUG=551553 Committed: https://crrev.com/044c76e83b828c23e7e9f317d3db9304046dbb56 Cr-Commit-Position: refs/heads/master@{#361279}

Patch Set 1 #

Patch Set 2 : Fix CSSPropertyMetadata::isEnabledProperty #

Total comments: 14

Patch Set 3 : Address comments #

Total comments: 7

Patch Set 4 : add cssText test #

Patch Set 5 : Adopt template specialization approach #

Patch Set 6 : make api more consistent #

Patch Set 7 : fix the build #

Patch Set 8 : fix for realz #

Total comments: 4

Patch Set 9 : Use static_assert. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+341 lines, -88 lines) Patch
A third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model-expected.txt View 1 2 3 1 chunk +17 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl View 1 2 3 4 5 6 7 8 1 chunk +12 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.cpp View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSStyleDeclaration.h View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSValue.cpp View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp View 1 2 3 4 5 6 7 8 6 chunks +48 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/core/css/StylePropertySerializer.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/StylePropertySerializer.cpp View 1 2 3 chunks +20 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/StylePropertySet.h View 1 2 3 4 5 6 chunks +31 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/css/StylePropertySet.cpp View 1 2 3 4 5 6 7 9 chunks +115 lines, -42 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParser.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParser.cpp View 2 chunks +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParserImpl.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp View 1 2 3 chunks +12 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSVariableParser.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSVariableParser.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 45 (12 generated)
leviw_travelin_and_unemployed
5 years, 1 month ago (2015-11-07 00:50:43 UTC) #4
leviw_travelin_and_unemployed
ping
5 years, 1 month ago (2015-11-09 19:44:48 UTC) #5
Timothy Loh
On 2015/11/09 19:44:48, leviw wrote: > ping test looks fine, I'm way too tired to ...
5 years, 1 month ago (2015-11-09 19:55:54 UTC) #6
leviw_travelin_and_unemployed
On 2015/11/09 at 19:55:54, timloh wrote: > On 2015/11/09 19:44:48, leviw wrote: > > ping ...
5 years, 1 month ago (2015-11-12 19:32:55 UTC) #7
Timothy Loh
Seems okay overall https://codereview.chromium.org/1405293012/diff/20001/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp File third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp (right): https://codereview.chromium.org/1405293012/diff/20001/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp#newcode227 third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp:227: // TODO(leviw): This API doesn't support ...
5 years, 1 month ago (2015-11-14 02:21:05 UTC) #8
leviw_travelin_and_unemployed
PTAL https://codereview.chromium.org/1405293012/diff/20001/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp File third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp (right): https://codereview.chromium.org/1405293012/diff/20001/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp#newcode227 third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp:227: // TODO(leviw): This API doesn't support custom properties. ...
5 years, 1 month ago (2015-11-17 01:25:07 UTC) #9
alancutter (OOO until 2018)
https://codereview.chromium.org/1405293012/diff/40001/third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html File third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html (right): https://codereview.chromium.org/1405293012/diff/40001/third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html#newcode29 third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html:29: '"NoModificationAllowedError: Failed to execute \'setProperty\' on \'CSSStyleDeclaration\': These styles ...
5 years, 1 month ago (2015-11-17 07:10:42 UTC) #10
leviw_travelin_and_unemployed
https://codereview.chromium.org/1405293012/diff/40001/third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html File third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html (right): https://codereview.chromium.org/1405293012/diff/40001/third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html#newcode29 third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html:29: '"NoModificationAllowedError: Failed to execute \'setProperty\' on \'CSSStyleDeclaration\': These styles ...
5 years, 1 month ago (2015-11-17 07:23:44 UTC) #11
leviw_travelin_and_unemployed
ping
5 years, 1 month ago (2015-11-18 17:14:39 UTC) #12
alancutter (OOO until 2018)
Shoot, I meant to send this yesterday, sorry. https://codereview.chromium.org/1405293012/diff/40001/third_party/WebKit/Source/core/css/StylePropertySet.cpp File third_party/WebKit/Source/core/css/StylePropertySet.cpp (right): https://codereview.chromium.org/1405293012/diff/40001/third_party/WebKit/Source/core/css/StylePropertySet.cpp#newcode564 third_party/WebKit/Source/core/css/StylePropertySet.cpp:564: On ...
5 years, 1 month ago (2015-11-18 21:22:51 UTC) #13
leviw_travelin_and_unemployed
On 2015/11/18 at 21:22:51, alancutter wrote: > Shoot, I meant to send this yesterday, sorry. ...
5 years, 1 month ago (2015-11-18 21:26:33 UTC) #14
Timothy Loh
https://codereview.chromium.org/1405293012/diff/40001/third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html File third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html (right): https://codereview.chromium.org/1405293012/diff/40001/third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html#newcode29 third_party/WebKit/LayoutTests/fast/css/variables/custom-properties-in-object-model.html:29: '"NoModificationAllowedError: Failed to execute \'setProperty\' on \'CSSStyleDeclaration\': These styles ...
5 years, 1 month ago (2015-11-19 00:47:42 UTC) #15
leviw_travelin_and_unemployed
PTAL
5 years, 1 month ago (2015-11-20 06:21:11 UTC) #16
alancutter (OOO until 2018)
lgtm https://codereview.chromium.org/1405293012/diff/140001/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl File third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl (right): https://codereview.chromium.org/1405293012/diff/140001/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl#newcode40 third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl:40: enabledProperties->clear(0); Is this ever hit? It doesn't look ...
5 years, 1 month ago (2015-11-23 05:24:00 UTC) #17
leviw_travelin_and_unemployed
On 2015/11/23 at 05:24:00, alancutter wrote: > lgtm > > https://codereview.chromium.org/1405293012/diff/140001/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl > File third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl (right): ...
5 years, 1 month ago (2015-11-23 18:13:06 UTC) #18
leviw_travelin_and_unemployed
On 2015/11/23 at 18:13:06, leviw wrote: > On 2015/11/23 at 05:24:00, alancutter wrote: > > ...
5 years, 1 month ago (2015-11-23 20:59:20 UTC) #19
leviw_travelin_and_unemployed
On 2015/11/23 at 20:59:20, leviw wrote: > On 2015/11/23 at 18:13:06, leviw wrote: > > ...
5 years, 1 month ago (2015-11-23 21:03:07 UTC) #20
alancutter (OOO until 2018)
lgtm with nit. We should wait for timloh's review before landing. Want us to tick ...
5 years, 1 month ago (2015-11-23 21:55:33 UTC) #21
alancutter (OOO until 2018)
https://codereview.chromium.org/1405293012/diff/140001/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl File third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl (right): https://codereview.chromium.org/1405293012/diff/140001/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl#newcode40 third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl:40: enabledProperties->clear(0); On 2015/11/23 at 21:55:33, alancutter wrote: > We ...
5 years, 1 month ago (2015-11-23 22:20:47 UTC) #22
leviw_travelin_and_unemployed
On 2015/11/23 at 22:20:47, alancutter wrote: > https://codereview.chromium.org/1405293012/diff/140001/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl > File third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl (right): > > https://codereview.chromium.org/1405293012/diff/140001/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl#newcode40 ...
5 years, 1 month ago (2015-11-23 22:30:51 UTC) #23
Timothy Loh
lgtm
5 years, 1 month ago (2015-11-23 23:49:30 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1405293012/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1405293012/160001
5 years, 1 month ago (2015-11-23 23:51:32 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/121529)
5 years ago (2015-11-24 01:44:02 UTC) #29
leviw_travelin_and_unemployed
Adding a few bindings owners: PTAL at V8CSSStyleDeclarationCustom.cpp and if you approve, hit the CQ ...
5 years ago (2015-11-24 01:46:51 UTC) #31
haraken
On 2015/11/24 01:46:51, leviw wrote: > Adding a few bindings owners: PTAL at V8CSSStyleDeclarationCustom.cpp and ...
5 years ago (2015-11-24 01:48:09 UTC) #32
leviw_travelin_and_unemployed
Thanks for the super quick review!
5 years ago (2015-11-24 01:48:37 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1405293012/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1405293012/160001
5 years ago (2015-11-24 01:51:54 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/133394)
5 years ago (2015-11-24 03:47:33 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1405293012/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1405293012/160001
5 years ago (2015-11-24 05:41:49 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/133527)
5 years ago (2015-11-24 07:26:09 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1405293012/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1405293012/160001
5 years ago (2015-11-24 07:28:01 UTC) #43
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years ago (2015-11-24 07:58:52 UTC) #44
commit-bot: I haz the power
5 years ago (2015-11-24 07:59:48 UTC) #45
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/044c76e83b828c23e7e9f317d3db9304046dbb56
Cr-Commit-Position: refs/heads/master@{#361279}

Powered by Google App Engine
This is Rietveld 408576698