WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WORKSFORME
128067
Adopt URLUtils interface and template in HTMLAnchorElement and HTMLAreaElement
https://bugs.webkit.org/show_bug.cgi?id=128067
Summary
Adopt URLUtils interface and template in HTMLAnchorElement and HTMLAreaElement
Maciej Stachowiak
Reported
2014-02-01 23:38:15 PST
Adopt URLUtils interface and template in HTMLAnchorElement and HTMLAreaElement
Attachments
Patch
(11.91 KB, patch)
2014-02-01 23:39 PST
,
Maciej Stachowiak
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2
(468.17 KB, application/zip)
2014-02-02 00:33 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion
(503.37 KB, application/zip)
2014-02-02 01:00 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion
(503.33 KB, application/zip)
2014-02-02 01:58 PST
,
Build Bot
no flags
Details
Patch
(23.43 KB, patch)
2014-02-02 12:00 PST
,
Maciej Stachowiak
koivisto
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Maciej Stachowiak
Comment 1
2014-02-01 23:39:17 PST
Created
attachment 222913
[details]
Patch
WebKit Commit Bot
Comment 2
2014-02-01 23:39:53 PST
Attachment 222913
[details]
did not pass style-queue: ERROR: Source/WebCore/ChangeLog:8: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Maciej Stachowiak
Comment 3
2014-02-01 23:43:00 PST
Comment on
attachment 222913
[details]
Patch Unflagging; posted for EWS purposes only.
Build Bot
Comment 4
2014-02-02 00:33:50 PST
Comment on
attachment 222913
[details]
Patch
Attachment 222913
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/5656720835608576
New failing tests: fast/dom/element-attribute-js-null.html js/dom/dom-static-property-for-in-iteration.html
Build Bot
Comment 5
2014-02-02 00:33:52 PST
Created
attachment 222916
[details]
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-13 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Build Bot
Comment 6
2014-02-02 01:00:14 PST
Comment on
attachment 222913
[details]
Patch
Attachment 222913
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/5938195812319232
New failing tests: fast/dom/element-attribute-js-null.html js/dom/dom-static-property-for-in-iteration.html
Build Bot
Comment 7
2014-02-02 01:00:18 PST
Created
attachment 222917
[details]
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-02 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Build Bot
Comment 8
2014-02-02 01:58:25 PST
Comment on
attachment 222913
[details]
Patch
Attachment 222913
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/6223781072732160
New failing tests: fast/dom/element-attribute-js-null.html js/dom/dom-static-property-for-in-iteration.html
Build Bot
Comment 9
2014-02-02 01:58:27 PST
Created
attachment 222920
[details]
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-05 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Maciej Stachowiak
Comment 10
2014-02-02 12:00:47 PST
Created
attachment 222929
[details]
Patch
mitz
Comment 11
2014-02-02 12:33:13 PST
Comment on
attachment 222929
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=222929&action=review
Looks OK, but still doesn’t build on Windows.
> Source/WebCore/html/HTMLAnchorElement.h:66 > void setHref(const AtomicString&); > + void setHref(const AtomicString& value, ExceptionCode&) { setHref(value); }
Is it valid to call this in a manner that throws an exception? If not, shouldn’t we just use the ASSERT_NO_EXCEPTION mechanism?
> LayoutTests/js/dom/dom-static-property-for-in-iteration.html:9 > + <div id="console"></div>
Did you intend to make this change? It seems like this is responsible for many of the changes to the result above.
Antti Koivisto
Comment 12
2014-02-02 13:42:10 PST
Comment on
attachment 222929
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=222929&action=review
Looks good except for the strange test change.
>> Source/WebCore/html/HTMLAnchorElement.h:66 >> + void setHref(const AtomicString& value, ExceptionCode&) { setHref(value); } > > Is it valid to call this in a manner that throws an exception? If not, shouldn’t we just use the ASSERT_NO_EXCEPTION mechanism?
If argument-free version is for internal use only and not part of the DOM then it is much better to keep it separate rather than uglify our code with ASSERT_NO_EXCEPTION.
Darin Adler
Comment 13
2014-02-02 16:14:45 PST
Comment on
attachment 222929
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=222929&action=review
>>> Source/WebCore/html/HTMLAnchorElement.h:66 >>> + void setHref(const AtomicString& value, ExceptionCode&) { setHref(value); } >> >> Is it valid to call this in a manner that throws an exception? If not, shouldn’t we just use the ASSERT_NO_EXCEPTION mechanism? > > If argument-free version is for internal use only and not part of the DOM then it is much better to keep it separate rather than uglify our code with ASSERT_NO_EXCEPTION.
Normally, I would say that I think the right fix here is to change the IDL file, since setting href can’t raise an exception. But HTMLAnchorElement’s IDL file doesn’t create any calls to setHref, because href is a “reflect” attribute, so it calls setURLAttribute directly. Thus I don’t understand why this is needed at all? Where is the call site?
Maciej Stachowiak
Comment 14
2014-02-02 20:18:55 PST
(In reply to
comment #11
)
> (From update of
attachment 222929
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=222929&action=review
> > Looks OK, but still doesn’t build on Windows. > > > Source/WebCore/html/HTMLAnchorElement.h:66 > > void setHref(const AtomicString&); > > + void setHref(const AtomicString& value, ExceptionCode&) { setHref(value); } > > Is it valid to call this in a manner that throws an exception? If not, shouldn’t we just use the ASSERT_NO_EXCEPTION mechanism?
Not sure what you mean. The exception code is passed in, not out. This method will never throw an exception itself. The exception argument is only because the href setter is declared as possibly throwing in URLUtils.idl, but the HTMLAnchorElement version will never actually throw.
> > > LayoutTests/js/dom/dom-static-property-for-in-iteration.html:9 > > + <div id="console"></div> > > Did you intend to make this change? It seems like this is responsible for many of the changes to the result above.
Yes. I wanted to move the link above the output, so that its position would not change solely due to a new property being added (since its hard to tell if the new offset is correct).
Maciej Stachowiak
Comment 15
2014-02-02 20:20:45 PST
(In reply to
comment #13
)
> (From update of
attachment 222929
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=222929&action=review
> > >>> Source/WebCore/html/HTMLAnchorElement.h:66 > >>> + void setHref(const AtomicString& value, ExceptionCode&) { setHref(value); } > >> > >> Is it valid to call this in a manner that throws an exception? If not, shouldn’t we just use the ASSERT_NO_EXCEPTION mechanism? > > > > If argument-free version is for internal use only and not part of the DOM then it is much better to keep it separate rather than uglify our code with ASSERT_NO_EXCEPTION. > > Normally, I would say that I think the right fix here is to change the IDL file, since setting href can’t raise an exception. > > But HTMLAnchorElement’s IDL file doesn’t create any calls to setHref, because href is a “reflect” attribute, so it calls setURLAttribute directly. Thus I don’t understand why this is needed at all? Where is the call site?
HTMLAnchorElement now no longer defines href itself; instead it is defined in URLUtils.idl. Officially per the URL and HTML specs, HTMLAnchorElement is now supposed to get its href by implementing URLUtils rather than directly. This also means that it can't be a "reflect" attribute now, because URLUtil is also used by interfaces that are not elements. Specifically by DOMURL, which can throw from the href setter, which is why it has the possibility of exceptions which don't actually apply here.
Maciej Stachowiak
Comment 16
2014-02-03 03:08:54 PST
Committed
r163299
: <
http://trac.webkit.org/changeset/163299
>
Csaba Osztrogonác
Comment 17
2014-02-03 04:09:31 PST
(In reply to
comment #16
)
> Committed
r163299
: <
http://trac.webkit.org/changeset/163299
>
FYI: It broke the Apple Windows build, as the EWS noticed it before landing.
Csaba Osztrogonác
Comment 18
2014-02-03 05:59:06 PST
And it broke the build on the 32 bit Apple Mountain Lion bot too:
http://build.webkit.org/builders/Apple%20MountainLion%20Release%20%2832-bit%20Build%29/builds/8846
Jessie Berlin
Comment 19
2014-02-03 09:02:34 PST
I am going to roll out this patch, since it broke a number of builds. Output for the ML 32-bit release build: /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:248:14: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int') /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:267:30: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int') /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:287:14: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int') /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:248:14: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int') /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:267:30: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int') /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:287:14: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int')
Jessie Berlin
Comment 20
2014-02-03 09:25:08 PST
(In reply to
comment #19
)
> I am going to roll out this patch, since it broke a number of builds. Output for the ML 32-bit release build: > > /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:248:14: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int') > /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:267:30: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int') > /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:287:14: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int') > /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:248:14: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int') > /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:267:30: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int') > /Volumes/Data/slave/mountainlion-32bit-release/build/Source/WebCore/html/URLUtils.h:287:14: error: use of overloaded operator '[]' is ambiguous (with operand types 'const WTF::String' and 'int')
Rollout done in
http://trac.webkit.org/changeset/163309
Jessie Berlin
Comment 21
2014-02-03 09:25:32 PST
Re-opening due to the rollout.
Maciej Stachowiak
Comment 22
2017-11-17 23:22:32 PST
This has subsequently been done in a different, likely more modern way (as HTMLHyperlinkElementUtils).
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