RESOLVED FIXED 227464
Encoding specified in the 'charset' attribute should have precedence over 'content' attribute
https://bugs.webkit.org/show_bug.cgi?id=227464
Summary Encoding specified in the 'charset' attribute should have precedence over 'co...
Qiaosong Zhou
Reported 2021-06-28 15:11:01 PDT
Encoding specified in the 'charset' attribute should have precedence over 'content' attribute
Attachments
Patch (1.44 KB, patch)
2021-06-28 15:14 PDT, Qiaosong Zhou
no flags
Patch (3.05 KB, patch)
2021-06-28 16:59 PDT, Qiaosong Zhou
no flags
Patch (2.32 KB, patch)
2021-06-29 13:25 PDT, Qiaosong Zhou
no flags
Patch (2.32 KB, patch)
2021-06-29 13:53 PDT, Qiaosong Zhou
no flags
Patch (3.82 KB, patch)
2021-06-29 13:57 PDT, Qiaosong Zhou
no flags
Alex Christensen
Comment 1 2021-06-28 15:12:13 PDT
*** Bug 227463 has been marked as a duplicate of this bug. ***
Qiaosong Zhou
Comment 2 2021-06-28 15:14:11 PDT
Alex Christensen
Comment 3 2021-06-28 15:23:32 PDT
Comment on attachment 432428 [details] Patch Hooray! You successfully uploaded a patch.
Qiaosong Zhou
Comment 4 2021-06-28 16:59:41 PDT
Geoffrey Garen
Comment 5 2021-06-28 18:03:44 PDT
Comment on attachment 432444 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=432444&action=review r=me > Source/WebCore/ChangeLog:9 > + (WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes): It's nice to write a little explanation here about what made the previous logic incorrect, and how the new logic corrects it. Even if the case is pretty simple like this one.
Chris Dumez
Comment 6 2021-06-28 18:30:49 PDT
Comment on attachment 432444 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=432444&action=review >> Source/WebCore/ChangeLog:9 >> + (WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes): > > It's nice to write a little explanation here about what made the previous logic incorrect, and how the new logic corrects it. Even if the case is pretty simple like this one. Also, for compatibility changes such as this one, please make sure to test the behavior in Chrome and Firefox and provide the results in the ChangeLog. It is important as fixing tests may break compatibility with other browsers in some cases (because other browsers also fail said test).
Chris Dumez
Comment 7 2021-06-28 18:31:18 PDT
(In reply to Chris Dumez from comment #6) > Comment on attachment 432444 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=432444&action=review > > >> Source/WebCore/ChangeLog:9 > >> + (WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes): > > > > It's nice to write a little explanation here about what made the previous logic incorrect, and how the new logic corrects it. Even if the case is pretty simple like this one. > > Also, for compatibility changes such as this one, please make sure to test > the behavior in Chrome and Firefox and provide the results in the ChangeLog. > It is important as fixing tests may break compatibility with other browsers > in some cases (because other browsers also fail said test). For this particular test, I have verified via https://wpt.live/html/syntax/parsing/meta-inhead-insertion-mode.html that it passes on both Firefox and Chrome.
Alex Christensen
Comment 8 2021-06-28 18:37:03 PDT
Comment on attachment 432444 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=432444&action=review > Source/WebCore/html/parser/HTMLMetaCharsetParser.cpp:115 > mode = Charset; We could also increase performance a little by putting "break;" after this line instead of checking if mode != Charset for the rest of the attributes.
Qiaosong Zhou
Comment 9 2021-06-29 13:25:56 PDT
Chris Dumez
Comment 10 2021-06-29 13:28:57 PDT
Comment on attachment 432516 [details] Patch Where are the layout test changes?
Qiaosong Zhou
Comment 11 2021-06-29 13:53:04 PDT
Chris Dumez
Comment 12 2021-06-29 13:54:08 PDT
Comment on attachment 432522 [details] Patch Again this patch does not contain any test or test rebaseline.
Qiaosong Zhou
Comment 13 2021-06-29 13:57:09 PDT
EWS
Comment 14 2021-06-29 15:25:37 PDT
Committed r279391 (239256@main): <https://commits.webkit.org/239256@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 432523 [details].
Note You need to log in before you can comment on or make changes to this bug.