Bug 82689 - InsertHTML fails to insert h6 if the insertion point is before some text
Summary: InsertHTML fails to insert h6 if the insertion point is before some text
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2012-03-29 22:36 PDT by Ryosuke Niwa
Modified: 2012-04-13 07:29 PDT (History)
2 users (show)

See Also:


Attachments
First try (5.72 KB, patch)
2012-04-05 12:19 PDT, Yi Shen
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2012-03-29 22:36:07 PDT
WebKit fails to execute document.execCommand("insertHTML", false, '<h6>hello world</h6>'); properly (loses h6)
if the selection at the time is before some text.

Reduction:
http://jsbin.com/isibud/3/
(Click "Insert h6").

I suspect this is a bug in markup.cpp. The list of elements there is missing h6 for some reason.
Comment 1 Ryosuke Niwa 2012-03-29 22:36:21 PDT
http://crbug.com/117966
Comment 2 Yi Shen 2012-04-05 08:35:24 PDT
The issue is the isHeaderElement() in ReplaceSelectionCommand doesn't include h6Tag. Will provide a patch with tests soon.
Comment 3 Yi Shen 2012-04-05 12:19:03 PDT
Created attachment 135874 [details]
First try
Comment 4 Chang Shu 2012-04-12 12:20:47 PDT
Comment on attachment 135874 [details]
First try

The fix looks correct and neat. Did you run the entire layout tests?
Comment 5 Ryosuke Niwa 2012-04-12 12:24:11 PDT
Comment on attachment 135874 [details]
First try

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

> LayoutTests/editing/execCommand/4128080-1.html:15
> +    if (actual == expected)
> +        return "Success\n";

Can we output something for Success case as well so that it'll be easier to understand the output?
Comment 6 Yi Shen 2012-04-12 12:49:32 PDT
Thanks for reviewing. I will update the test case and commit the patch then.
Comment 7 Yi Shen 2012-04-13 07:29:12 PDT
Committed r114131: <http://trac.webkit.org/changeset/114131>