WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
148852
script.text should behave like script.textContent on setting
https://bugs.webkit.org/show_bug.cgi?id=148852
Summary
script.text should behave like script.textContent on setting
Ryosuke Niwa
Reported
2015-09-04 16:52:37 PDT
See
https://html.spec.whatwg.org/multipage/scripting.html#dom-script-text
The setter implementation of HTMLScriptElement.prototype.text should be identical to that of textContent but it isn't. This bug was found by the newly added test: LayoutTests/http/tests/w3c/html/semantics/scripting-1/the-script-element/script-text.html
Attachments
Patch
(3.26 KB, patch)
2016-08-27 09:21 PDT
,
Andreas Kling
cdumez
: review+
cdumez
: commit-queue-
Details
Formatted Diff
Diff
Patch for landing
(3.26 KB, patch)
2016-08-27 10:16 PDT
,
Andreas Kling
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Andreas Kling
Comment 1
2016-08-27 09:21:00 PDT
Created
attachment 287204
[details]
Patch
Radar WebKit Bug Importer
Comment 2
2016-08-27 09:21:39 PDT
<
rdar://problem/28044640
>
Chris Dumez
Comment 3
2016-08-27 09:57:29 PDT
Comment on
attachment 287204
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=287204&action=review
r=me with comment.
> Source/WebCore/html/HTMLScriptElement.cpp:85 > + setTextContent(value, IGNORE_EXCEPTION);
I believe this cannot actually throw. If this is the case, then we should use ASSERT_NOT_EXCEPTION, not IGNORE_EXCEPTION. If it can actually throw, then we should use [SetterRaisesException] on the text attribute and relay the exception to the caller.
Andreas Kling
Comment 4
2016-08-27 10:02:15 PDT
Comment on
attachment 287204
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=287204&action=review
>> Source/WebCore/html/HTMLScriptElement.cpp:85 >> + setTextContent(value, IGNORE_EXCEPTION); > > I believe this cannot actually throw. If this is the case, then we should use ASSERT_NOT_EXCEPTION, not IGNORE_EXCEPTION. If it can actually throw, then we should use [SetterRaisesException] on the text attribute and relay the exception to the caller.
Hmm. You are probably right about this. I suspect the same is also true for HTMLAnchorElement.text and HTMLTitleElement.text
Andreas Kling
Comment 5
2016-08-27 10:16:00 PDT
Created
attachment 287205
[details]
Patch for landing
WebKit Commit Bot
Comment 6
2016-08-27 10:47:00 PDT
Comment on
attachment 287205
[details]
Patch for landing Clearing flags on attachment: 287205 Committed
r205079
: <
http://trac.webkit.org/changeset/205079
>
WebKit Commit Bot
Comment 7
2016-08-27 10:47:05 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