Bug 123850 - [HTML parser] reset insertion mode appropriate must check for "in select in table" mode
Summary: [HTML parser] reset insertion mode appropriate must check for "in select in t...
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
Keywords: BlinkMergeCandidate
Depends on:
Blocks: 123851
  Show dependency treegraph
Reported: 2013-11-05 19:17 PST by Ryosuke Niwa
Modified: 2013-11-20 22:08 PST (History)
11 users (show)

See Also:

Fixes the bug (3.94 KB, patch)
2013-11-20 00:18 PST, Ryosuke Niwa
koivisto: review+
rniwa: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-11-05 19:17:15 PST
Merge https://chromium.googlesource.com/chromium/blink/+/2cb7523df57dfb48111f6aa16b7138cd54024ba7

The HTML spec has been updated to detect encountering a <template> inside of a <select> which is inside of a <table>. In this case the <select> will cause the parser to be in "InSelectInTable" mode. Thus when the <template> closes, it should return to that mode.

The fix here is that resetInsertionModeAppropriately must continue looking up the stack if the first node is <select> to see whether the <select> is inside of a <table>
Comment 1 Ryosuke Niwa 2013-11-20 00:18:30 PST
Created attachment 217396 [details]
Fixes the bug
Comment 2 Ryosuke Niwa 2013-11-20 00:35:55 PST
Comment on attachment 217396 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=217396&action=review

> Source/WebCore/html/parser/HTMLTreeBuilder.cpp:1645
> +                while (item->node() != m_tree.openElements()->rootNode() && !item->hasTagName(templateTag)) {

Oops, I need to wrap this entire block with ENABLE(TEMPLTE_ELEMENT).
Will do that before landing it.
Comment 3 Ryosuke Niwa 2013-11-20 19:35:51 PST
Comment on attachment 217396 [details]
Fixes the bug

Oops, I forgot to check my own comment :(
Comment 4 Ryosuke Niwa 2013-11-20 22:08:16 PST
Committed r159607: <http://trac.webkit.org/changeset/159607>