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

Issue 2549443003: Move <marquee> implementation to HTMLMarqueeElement.cpp (Closed)

Created:
4 years ago by adithyas
Modified:
4 years ago
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-html_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, jam
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move <marquee> implementation to HTMLMarqueeElement.cpp - Moves HTMLMarqueeElement off Blink-in-JS - Reimplements HTMLMarqueeElement in C++: implementation matches HTMLMarqueeElement.js and uses standard DOM API wherever possible - Removes HTMLMarqueeElement.js BUG=669656, 668618 Committed: https://crrev.com/a95f76a0318a32bf5bf1153fb291402806c298d1 Cr-Commit-Position: refs/heads/master@{#436628}

Patch Set 1 #

Patch Set 2 : Move out transform string creation into separate method #

Total comments: 29

Patch Set 3 : Address feedback #

Total comments: 15

Patch Set 4 : Code review #

Patch Set 5 : Add layout tests #

Total comments: 14

Patch Set 6 : Fix nits #

Total comments: 4

Patch Set 7 : Initialize attributes in insertedInto #

Total comments: 2

Patch Set 8 : Add asserts for didParse #

Total comments: 22
Unified diffs Side-by-side diffs Delta from patch set Stats (+564 lines, -448 lines) Patch
M content/child/blink_platform_impl.cc View 1 chunk +0 lines, -3 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/html/marquee-bgcolor.html View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/html/marquee-bgcolor-expected.html View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/html/marquee-vspace-hspace.html View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/html/marquee-vspace-hspace-expected.html View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/inline/inline-marquee-crash-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMarqueeElement.h View 1 2 3 4 5 6 3 chunks +100 lines, -0 lines 9 comments Download
M third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp View 1 2 3 4 5 6 7 2 chunks +428 lines, -21 lines 13 comments Download
M third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl View 2 chunks +13 lines, -19 lines 0 comments Download
D third_party/WebKit/Source/core/html/HTMLMarqueeElement.js View 1 chunk +0 lines, -402 lines 0 comments Download
M third_party/WebKit/public/blink_resources.grd View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 58 (30 generated)
adithyas
I've added in some inline comments to explain some layout test related changes. https://codereview.chromium.org/2549443003/diff/20001/third_party/WebKit/LayoutTests/fast/inline/inline-marquee-crash-expected.txt File ...
4 years ago (2016-12-01 20:30:48 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2549443003/20001
4 years ago (2016-12-01 20:31:17 UTC) #7
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
4 years ago (2016-12-01 20:31:18 UTC) #9
jbroman
(sheriffing; sorry for the slow reviews today and tomorrow) Some thoughts. Still need to have ...
4 years ago (2016-12-01 22:22:52 UTC) #14
haraken
I haven't looked at the details, but the overall approach looks good. Just check that ...
4 years ago (2016-12-02 00:09:38 UTC) #15
adithyas
haraken@: I tested with that link and the behavior seems to match. Also did some ...
4 years ago (2016-12-02 19:29:50 UTC) #18
jbroman
lgtm This seems like a faithful conversion of the current contents of HTMLMarqueeElement.js. The stringyness ...
4 years ago (2016-12-03 23:47:32 UTC) #21
haraken
LGTM Maybe do we want to send an Intent-to-remove for Blink-in-JS? (I can do that.) ...
4 years ago (2016-12-05 02:10:53 UTC) #22
adithyas
https://codereview.chromium.org/2549443003/diff/40001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp File third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp (right): https://codereview.chromium.org/2549443003/diff/40001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp#newcode314 third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp:314: const AtomicString& bhvr = getAttribute(HTMLNames::behaviorAttr); On 2016/12/03 at 23:47:31, ...
4 years ago (2016-12-05 16:44:27 UTC) #23
adithyas
+esprehn@ for content/child review
4 years ago (2016-12-05 16:45:29 UTC) #25
adithyas
jbroman@: I added a couple of layout tests, could you PTAL?
4 years ago (2016-12-05 18:55:36 UTC) #26
esprehn
You need to use parseAttribute instead of attributeChangedCallback, you don't need to parse the attributes ...
4 years ago (2016-12-05 19:19:42 UTC) #29
esprehn
https://codereview.chromium.org/2549443003/diff/80001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp File third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp (right): https://codereview.chromium.org/2549443003/diff/80001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp#newcode94 third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp:94: attributeChangedCallback(name, newValue); I see, you do actually call attributeChangedCallback ...
4 years ago (2016-12-05 20:02:01 UTC) #30
adithyas
https://codereview.chromium.org/2549443003/diff/80001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp File third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp (right): https://codereview.chromium.org/2549443003/diff/80001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp#newcode67 third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp:67: ShadowRoot* shadow = On 2016/12/05 at 19:19:42, esprehn wrote: ...
4 years ago (2016-12-05 21:03:41 UTC) #33
jbroman
layout test lgtm; I'm happy when esprehn is :)
4 years ago (2016-12-05 21:49:04 UTC) #34
esprehn
https://codereview.chromium.org/2549443003/diff/100001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp File third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp (right): https://codereview.chromium.org/2549443003/diff/100001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp#newcode195 third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp:195: void HTMLMarqueeElement::initializeAttribute(const QualifiedName& attr) { Lets just inline this ...
4 years ago (2016-12-05 22:01:38 UTC) #35
adithyas
https://codereview.chromium.org/2549443003/diff/100001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp File third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp (right): https://codereview.chromium.org/2549443003/diff/100001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp#newcode224 third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp:224: } else if (attr == HTMLNames::styleAttr) { On 2016/12/05 ...
4 years ago (2016-12-05 22:21:00 UTC) #36
esprehn
I see, lets go back to what the old code did and call the initialize ...
4 years ago (2016-12-05 22:23:39 UTC) #37
adithyas
I've changed it back to initializing attributes inside insertedInto. https://codereview.chromium.org/2549443003/diff/100001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp File third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp (right): https://codereview.chromium.org/2549443003/diff/100001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp#newcode195 third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp:195: ...
4 years ago (2016-12-05 22:41:02 UTC) #38
esprehn
lgtm
4 years ago (2016-12-05 23:28:33 UTC) #41
alancutter (OOO until 2018)
Animation API lgtm with comment. Please add 668618 to the list of bugs fixed by ...
4 years ago (2016-12-06 04:26:57 UTC) #45
adithyas
https://codereview.chromium.org/2549443003/diff/120001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp File third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp (right): https://codereview.chromium.org/2549443003/diff/120001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp#newcode254 third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp:254: styleSheetContents); On 2016/12/06 at 04:26:57, alancutter wrote: > Add ...
4 years ago (2016-12-06 15:43:00 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2549443003/140001
4 years ago (2016-12-06 15:44:05 UTC) #50
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years ago (2016-12-06 17:42:25 UTC) #52
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/a95f76a0318a32bf5bf1153fb291402806c298d1 Cr-Commit-Position: refs/heads/master@{#436628}
4 years ago (2016-12-06 17:44:04 UTC) #54
tkent
https://codereview.chromium.org/2549443003/diff/140001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp File third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp (right): https://codereview.chromium.org/2549443003/diff/140001/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp#newcode90 third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp:90: void HTMLMarqueeElement::attributeChanged(const QualifiedName& name, Overriding attributeChanged looks weird. Doesn't ...
4 years ago (2016-12-06 22:43:12 UTC) #56
esprehn
Please fix toInt() to not have an overflow instead of creating some wrapper around it. ...
4 years ago (2016-12-07 00:10:00 UTC) #57
adithyas
4 years ago (2016-12-08 15:12:11 UTC) #58
Message was sent while issue was closed.
I've addressed most of tkent's comments in this CL: http://crrev.com/2554403002

https://codereview.chromium.org/2549443003/diff/140001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp (right):

https://codereview.chromium.org/2549443003/diff/140001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp:133: int scrollAmount
= getAttribute(HTMLNames::scrollamountAttr).toInt(&ok);
On 2016/12/07 at 00:10:00, esprehn wrote:
> On 2016/12/06 at 22:43:11, tkent wrote:
> > Please do not use AtomicString::toInt().  It isn't compatible with the HTML
standard, and has an integer-overflow bug.  We should use parseHTMLInteger().
> > 
> > Probably we should introduce Element::getUnsignedIntegralAttribute(const
QualifiedName&, int fallbackValue).
> 
> Please fix the toInt() to not have an overflow. :)

I'm not really sure about the overflow bug, I couldn't reproduce it (assuming
this is the bug you're talking about: http://crbug.com/666681). Also
parseHTMLInteger doesn't work in this scenario because there's no way of knowing
if the actual user input was NaN (in which case, the default value should be
returned instead of 0).

https://codereview.chromium.org/2549443003/diff/140001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp:316: if (behavior ==
"alternate")
On 2016/12/06 at 22:43:11, tkent wrote:
> Should it be case-sensitive match?

Nope, this is a bug, thanks for catching it.

https://codereview.chromium.org/2549443003/diff/140001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp:483: return
AtomicString(String::format("translate%c(%fpx)", axis, value));
On 2016/12/06 at 22:43:11, tkent wrote:
> Does this work in French locale, which use ',' for decimal point?

I don't think it does, thanks for pointing this out.

https://codereview.chromium.org/2549443003/diff/140001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/html/HTMLMarqueeElement.h (right):

https://codereview.chromium.org/2549443003/diff/140001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/html/HTMLMarqueeElement.h:132: bool trueSpeed()
const;
On 2016/12/07 at 00:10:00, esprehn wrote:
> On 2016/12/06 at 22:43:11, tkent wrote:
> > I don't think this function is necessary.  It's used only once.
> 
> This is web exposed API.

This function is private, the web exposed API is implemented with [Reflect], so
I'll just inline this.

Powered by Google App Engine
This is Rietveld 408576698