WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
261180
Fix inconsistent LengthMode definition for 'textLength'
https://bugs.webkit.org/show_bug.cgi?id=261180
Summary
Fix inconsistent LengthMode definition for 'textLength'
Ahmad Saleem
Reported
2023-09-05 14:58:52 PDT
Hi Team, While going through Blink's commit, I came across another potential merge and looked in Blink's latest source code and the length is still 'Width'. Blink Commit -
https://src.chromium.org/viewvc/blink?view=revision&revision=189707
WebKit Source -
https://github.com/WebKit/WebKit/blob/94ce519cd2eaba3a1f2f4cb9753f40c98e9d9472/Source/WebCore/svg/SVGTextContentElement.cpp#L175
From changing: m_textLength->setBaseValInternal(SVGLengthValue::construct(SVGLengthMode::Other to m_textLength->setBaseValInternal(SVGLengthValue::construct(SVGLengthMode::Width ___ Just raising so we can fix it. Thanks!
Attachments
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2023-09-05 15:19:22 PDT
Although this commit deleted other use:
https://github.com/WebKit/WebKit/commit/4c53eb1e29f8c451411f0ef7f5f47d84adeb3118
Ahmad Saleem
Comment 2
2023-09-06 03:08:56 PDT
Chromium Source:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/svg/svg_text_content_element.cc;l=67?q=SVGAnimatedTextLength
and class SVGAnimatedTextLength final : public SVGAnimatedLength { public: SVGAnimatedTextLength(SVGTextContentElement* context_element) : SVGAnimatedLength(context_element, svg_names::kTextLengthAttr, SVGLengthMode::kWidth, <----- HERE SVGLength::Initial::kUnitlessZero) {}
Ahmad Saleem
Comment 3
2023-09-09 15:22:31 PDT
We don't crash in --debug build on top of WebKit ToT and running this test via --debug flag.
Radar WebKit Bug Importer
Comment 4
2023-09-12 14:59:15 PDT
<
rdar://problem/115389551
>
Said Abou-Hallawa
Comment 5
2023-09-12 18:05:00 PDT
In WebKit we do not have inconsistency in the LengthMode when changing the baseVal of 'textLength'. This is how we create the textLength in SVGTextContentElement: Ref<SVGAnimatedLength> m_textLength { SVGAnimatedLength::create(this, SVGLengthMode::Other) }; And this is how we change its baseVal m_textLength->setBaseValInternal(SVGLengthValue::construct(SVGLengthMode::Other, newValue, parseError, SVGLengthNegativeValuesMode::Forbid)); So the LengthMode is always SVGLengthMode::Other. If you want to change the LengthMode to be SVGLengthMode::Width, please retitle this bug. Otherwise please close it.
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