Bug 8750 - w3c.org: incorrect recovery from unclosed <a> elements
Summary: w3c.org: incorrect recovery from unclosed <a> elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://www.w3.org/TR/charmod-norm/
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2006-05-05 05:44 PDT by Alexey Proskuryakov
Modified: 2007-05-14 22:27 PDT (History)
1 user (show)

See Also:


Attachments
test case (306 bytes, text/html)
2006-05-05 05:45 PDT, Alexey Proskuryakov
no flags Details
Test case with explicit close tag (307 bytes, text/html)
2007-05-12 09:40 PDT, mitz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2006-05-05 05:44:36 PDT
Steps to reproduce:
1. Open http://www.w3.org/TR/charmod-norm/
2. Click on an editor name

Results: the whole paragraph turns red. Doesn't happen in WinIE or Firefox.

This is related to W3C serving XHTML documents with self-closing <a> tags as text/html - looks like WebKit recovery doesn't match other browsers. I've seen this problem with many other W3C documents besides charmod-norm.
Comment 1 Alexey Proskuryakov 2006-05-05 05:45:08 PDT
Created attachment 8123 [details]
test case
Comment 2 mitz 2007-05-12 09:40:56 PDT
Created attachment 14519 [details]
Test case with explicit close tag

Although typically seen with <a>, this can be seen with the other residual style tags (which allow nesting). The root cause for the bug in this case is the following, from handleResidualStyleCloseTagAcrossBlocks():

// Find the element that crosses over to a higher level.   For now, if there is more than
// one, we will just give up and not attempt any sort of correction.  It's highly unlikely that
// there will be more than one, since <p> tags aren't allowed to be nested.
Comment 3 Dave Hyatt 2007-05-12 14:58:37 PDT
Hah.  Yeah I thought this could return to get me some day when I wrote that comment. :)
Comment 4 Mark Rowe (bdash) 2007-05-14 22:27:15 PDT
Fixed in r21472.