WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
199843
[SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and <rect> elements
https://bugs.webkit.org/show_bug.cgi?id=199843
Summary
[SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and <rect> elements
Said Abou-Hallawa
Reported
2019-07-16 16:37:52 PDT
Specs:
https://www.w3.org/TR/SVG/geometry.html#RX
Test case: <svg xmlns="
http://www.w3.org/2000/svg
"> <ellipse style="rx: auto;" ry="30" cx="50" cy="50" fill="none" stroke="blue" stroke-width="5"/> </svg>
Attachments
Patch
(24.84 KB, patch)
2019-09-18 09:57 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(25.00 KB, patch)
2019-09-18 11:13 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(25.07 KB, patch)
2019-09-19 10:48 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(1.78 KB, patch)
2019-09-20 08:49 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Said Abou-Hallawa
Comment 1
2019-07-25 13:09:31 PDT
WPT failed tests:
http://web-platform-tests.live/svg/shapes/ellipse-02.svg
http://web-platform-tests.live/svg/shapes/ellipse-03.svg
http://web-platform-tests.live/svg/shapes/ellipse-05.svg
http://web-platform-tests.live/svg/shapes/ellipse-06.svg
http://web-platform-tests.live/svg/shapes/ellipse-07.svg
http://web-platform-tests.live/svg/shapes/ellipse-08.svg
Said Abou-Hallawa
Comment 2
2019-07-25 14:16:10 PDT
http://web-platform-tests.live/svg/shapes/rx-ry-not-inherited.svg
Said Abou-Hallawa
Comment 3
2019-09-18 09:57:59 PDT
Created
attachment 379046
[details]
Patch
Nikolas Zimmermann
Comment 4
2019-09-18 10:05:48 PDT
Comment on
attachment 379046
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=379046&action=review
Nice tests, thanks Said.
> LayoutTests/ChangeLog:3 > + [SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and<rect> elements
and<rect> -> and <rect>
> LayoutTests/ChangeLog:8 > + Skip the tests with dynmaic chnages till
webkit.org/b/201918
is fixed.
typo: dynamic changes. Maybe add one sentence regarding the new tests?
Said Abou-Hallawa
Comment 5
2019-09-18 11:13:45 PDT
Created
attachment 379050
[details]
Patch
Said Abou-Hallawa
Comment 6
2019-09-18 11:19:11 PDT
Comment on
attachment 379046
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=379046&action=review
>> LayoutTests/ChangeLog:3 >> + [SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and<rect> elements > > and<rect> -> and <rect>
Fixed. I just realized the space key in my keyboard is malfunctioning. It got stuck many times while typing this comment.
>> LayoutTests/ChangeLog:8 >> + Skip the tests with dynmaic chnages till
webkit.org/b/201918
is fixed. > > typo: dynamic changes. > Maybe add one sentence regarding the new tests?
The typo is fixed and comments were added regarding the new tests.
Nikolas Zimmermann
Comment 7
2019-09-18 11:23:41 PDT
Comment on
attachment 379050
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=379050&action=review
Sorry, just found another typo :/ For me the code changes look just fine.
> Source/WebCore/ChangeLog:8 > + The sepcs is:
https://www.w3.org/TR/SVG2/geometry.html#RxProperty
.
sepcs, spec :-)
> Source/WebCore/ChangeLog:11 > + parse LengthOrAuto for these properties. Handle the case if one of them
s/these /these /
Simon Fraser (smfr)
Comment 8
2019-09-19 02:54:49 PDT
Comment on
attachment 379050
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=379050&action=review
> Source/WebCore/rendering/svg/RenderSVGEllipse.cpp:92 > + Length rx = style().svgStyle().rx().isAuto() ? style().svgStyle().ry() : style().svgStyle().rx();
Maybe avoid reading style().svgStyle().rx() twice. Length rx = style().svgStyle().rx(); if (rx.isAuto() rx = style().svgStyle().ry();
Said Abou-Hallawa
Comment 9
2019-09-19 10:48:24 PDT
Created
attachment 379147
[details]
Patch
WebKit Commit Bot
Comment 10
2019-09-19 13:51:33 PDT
The commit-queue encountered the following flaky tests while processing
attachment 379147
[details]
: imported/w3c/web-platform-tests/websockets/bufferedAmount-unchanged-by-sync-xhr.any.worker.html
bug 202003
(author:
youennf@gmail.com
) The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 11
2019-09-19 13:52:36 PDT
Comment on
attachment 379147
[details]
Patch Clearing flags on attachment: 379147 Committed
r250103
: <
https://trac.webkit.org/changeset/250103
>
WebKit Commit Bot
Comment 12
2019-09-19 13:52:39 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 13
2019-09-19 13:53:16 PDT
<
rdar://problem/55532838
>
Darin Adler
Comment 14
2019-09-19 17:55:57 PDT
Comment on
attachment 379147
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=379147&action=review
> Source/WebCore/rendering/svg/RenderSVGEllipse.cpp:98 > + Length rx = style().svgStyle().rx(); > + if (rx.isAuto()) > + rx = style().svgStyle().ry(); > + > + Length ry = style().svgStyle().ry(); > + if (ry.isAuto()) > + ry = style().svgStyle().rx();
How about this alternative version? Length rx = style().svgStyle().rx(); Length ry = style().svgStyle().ry(); if (rx.isAuto()) rx = ry; else if (ry.isAuto()) ry = rx;
Said Abou-Hallawa
Comment 15
2019-09-19 18:25:42 PDT
Comment on
attachment 379147
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=379147&action=review
>> Source/WebCore/rendering/svg/RenderSVGEllipse.cpp:98 >> + ry = style().svgStyle().rx(); > > How about this alternative version? > > Length rx = style().svgStyle().rx(); > Length ry = style().svgStyle().ry(); > if (rx.isAuto()) > rx = ry; > else if (ry.isAuto()) > ry = rx;
I agree. -- In the worst case scenario, which happens when rx and ry are both 'auto', my solution will calculate rx/ry four times. It will also call the Length::operator==() four times. -- Your solution will calculate rx/ry two times and will call Length::operator==() three times. -- How about this? Length rx = style().svgStyle().rx(); Length ry = style().svgStyle().ry(); m_radii = FloatSize( lengthContext.valueForLength(rx.isAuto() ? ry : rx, SVGLengthMode::Width), lengthContext.valueForLength(ry.isAuto() ? rx : ry, SVGLengthMode::Height)); This will calculate rx/ry two times and will call Length::operator==() two times.
Said Abou-Hallawa
Comment 16
2019-09-20 08:49:43 PDT
Reopening to attach new patch.
Said Abou-Hallawa
Comment 17
2019-09-20 08:49:44 PDT
Created
attachment 379243
[details]
Patch
WebKit Commit Bot
Comment 18
2019-09-20 13:30:40 PDT
Comment on
attachment 379243
[details]
Patch Clearing flags on attachment: 379243 Committed
r250147
: <
https://trac.webkit.org/changeset/250147
>
WebKit Commit Bot
Comment 19
2019-09-20 13:30:42 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug