RESOLVED FIXED 124618
[css shapes] Parse new circle shape syntax
https://bugs.webkit.org/show_bug.cgi?id=124618
Summary [css shapes] Parse new circle shape syntax
Bem Jones-Bey
Reported 2013-11-19 17:00:32 PST
Implement the parsing of the new circle shape syntax.
Attachments
Patch (64.08 KB, patch)
2013-11-20 10:16 PST, Bem Jones-Bey
no flags
Updated Patch (64.09 KB, patch)
2013-11-20 11:25 PST, Bem Jones-Bey
no flags
Patch (64.09 KB, patch)
2013-11-20 11:58 PST, Bem Jones-Bey
no flags
Patch (64.10 KB, patch)
2013-11-20 13:19 PST, Bem Jones-Bey
no flags
Bem Jones-Bey
Comment 1 2013-11-20 10:16:41 PST
EFL EWS Bot
Comment 2 2013-11-20 10:22:56 PST
EFL EWS Bot
Comment 3 2013-11-20 10:26:13 PST
Bem Jones-Bey
Comment 4 2013-11-20 10:46:12 PST
The build failures are all because ASSERT_UNREACHED() doesn't do anything in a release build (And I only did a debug build locally). I've fixed it locally by initializing the variable in question, and will upload a new patch with that change (and any potential review feedback) in a bit.
Build Bot
Comment 5 2013-11-20 10:46:54 PST
Antti Koivisto
Comment 6 2013-11-20 10:50:07 PST
Comment on attachment 217454 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=217454&action=review ok though i don't really see how the new syntax is better > Source/WebCore/css/BasicShapeFunctions.cpp:85 > + return pool.createValue(center.length(), style); Not really in this patch but we need to get rid of CSSValues that take style. The factoring is just totally wrong. CSSValues are the input for constructing RenderStyle! > Source/WebCore/css/CSSBasicShapes.cpp:130 > + char opening[] = "circle("; > + char at[] = "at"; > + char separator[] = " "; > + StringBuilder result; > + // Compute the required capacity in advance to reduce allocations. > + result.reserveCapacity((sizeof(opening) - 1) + (3 * (sizeof(separator) - 1)) + 1 + radius.length() + sizeof(at) + centerX.length() + centerY.length()); There are probably some more modern ways to do this though I don't know what the recommended way is currently.
kov's GTK+ EWS bot
Comment 7 2013-11-20 11:02:30 PST
Bem Jones-Bey
Comment 8 2013-11-20 11:25:41 PST
Created attachment 217460 [details] Updated Patch
Sergio Correia (qrwteyrutiyoup)
Comment 9 2013-11-20 11:36:41 PST
Comment on attachment 217460 [details] Updated Patch View in context: https://bugs.webkit.org/attachment.cgi?id=217460&action=review > Source/WebCore/css/CSSBasicShapes.cpp:177 > + m_centerY ? m_centerY->serializeResolvingVariables(variables) : String()) , (comma) instead of the last closing parenthesis.
EFL EWS Bot
Comment 10 2013-11-20 11:39:28 PST
kov's GTK+ EWS bot
Comment 11 2013-11-20 11:49:32 PST
Bem Jones-Bey
Comment 12 2013-11-20 11:56:20 PST
(In reply to comment #9) > (From update of attachment 217460 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=217460&action=review > > > Source/WebCore/css/CSSBasicShapes.cpp:177 > > + m_centerY ? m_centerY->serializeResolvingVariables(variables) : String()) > > , (comma) instead of the last closing parenthesis. Thanks. I was about to ask why it compiled locally, then I realized that CSS_VARIABLES is turned off on the Mac port.
Bem Jones-Bey
Comment 13 2013-11-20 11:58:35 PST
Created attachment 217462 [details] Patch Third time's the charm?
EFL EWS Bot
Comment 14 2013-11-20 12:06:24 PST
EFL EWS Bot
Comment 15 2013-11-20 12:21:04 PST
Bem Jones-Bey
Comment 16 2013-11-20 13:19:42 PST
Created attachment 217471 [details] Patch Different warning settings on different ports make me a sad panda. Hopefully this one will pass all the EWS.
WebKit Commit Bot
Comment 17 2013-11-20 14:52:59 PST
Comment on attachment 217471 [details] Patch Clearing flags on attachment: 217471 Committed r159585: <http://trac.webkit.org/changeset/159585>
WebKit Commit Bot
Comment 18 2013-11-20 14:53:03 PST
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 19 2013-11-20 15:25:04 PST
Comment on attachment 217471 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=217471&action=review > Source/WebCore/css/CSSBasicShapes.cpp:130 > + result.reserveCapacity((sizeof(opening) - 1) + (3 * (sizeof(separator) - 1)) + 1 + radius.length() + sizeof(at) + centerX.length() + centerY.length()); I’m not sure this optimization actually works. The sizeof(at) part seems wrong. > Source/WebCore/css/CSSBasicShapes.cpp:131 > + result.append(opening); This needs to use appendLiteral. > Source/WebCore/css/CSSBasicShapes.cpp:137 > + result.append(separator); This needs to use appendLiteral. > Source/WebCore/css/CSSBasicShapes.cpp:138 > + result.append(at); This needs to use appendLiteral. > Source/WebCore/css/CSSBasicShapes.cpp:139 > + result.append(separator); This needs to use appendLiteral. > Source/WebCore/css/CSSBasicShapes.cpp:141 > + result.append(separator); This needs to use appendLiteral. > Source/WebCore/css/CSSBasicShapes.cpp:144 > + result.append(")"); This needs to use appendLiteral. > Source/WebCore/css/CSSBasicShapes.cpp:145 > + if (box.length()) { This should be !box.isEmpty() > Source/WebCore/css/CSSBasicShapes.cpp:146 > + result.append(separator); This needs to use appendLiteral.
Bem Jones-Bey
Comment 20 2013-11-21 09:31:29 PST
(In reply to comment #19) > (From update of attachment 217471 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=217471&action=review > > > Source/WebCore/css/CSSBasicShapes.cpp:130 > > + result.reserveCapacity((sizeof(opening) - 1) + (3 * (sizeof(separator) - 1)) + 1 + radius.length() + sizeof(at) + centerX.length() + centerY.length()); > > I’m not sure this optimization actually works. > > The sizeof(at) part seems wrong. > > > Source/WebCore/css/CSSBasicShapes.cpp:131 > > + result.append(opening); > > This needs to use appendLiteral. > > > Source/WebCore/css/CSSBasicShapes.cpp:137 > > + result.append(separator); > > This needs to use appendLiteral. > > > Source/WebCore/css/CSSBasicShapes.cpp:138 > > + result.append(at); > > This needs to use appendLiteral. > > > Source/WebCore/css/CSSBasicShapes.cpp:139 > > + result.append(separator); > > This needs to use appendLiteral. > > > Source/WebCore/css/CSSBasicShapes.cpp:141 > > + result.append(separator); > > This needs to use appendLiteral. > > > Source/WebCore/css/CSSBasicShapes.cpp:144 > > + result.append(")"); > > This needs to use appendLiteral. > > > Source/WebCore/css/CSSBasicShapes.cpp:145 > > + if (box.length()) { > > This should be !box.isEmpty() > > > Source/WebCore/css/CSSBasicShapes.cpp:146 > > + result.append(separator); > > This needs to use appendLiteral. I'm going to create a patch to implement the layout behavior. I'll make these changes in that patch.
Note You need to log in before you can comment on or make changes to this bug.