WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
30148
Applying h1 format to text node after HR tag fails to include first letter of text node.
https://bugs.webkit.org/show_bug.cgi?id=30148
Summary
Applying h1 format to text node after HR tag fails to include first letter of...
Michael Thomas
Reported
2009-10-06 19:54:29 PDT
STEPS TO REPRODUCE: 1. Go to midas demo:
http://www.mozilla.org/editor/midasdemo/
2. Enter the following HTML: '<hr>test' 3. Place the cursor after the word 'test'. 4. Select 'Heading 1' from the menu. RESULT: The heading style is applied to the entire line except the first character: <hr><h1><span class="Apple-style-span" style="font-weight: normal; font-size: medium; ">t</span>est</h1> EXPECTED: The heading style is applied to the entire line: <hr><h1>test</h1> Automated test case:
http://www.plexode.com/cgi-bin/eval3.py#ht=%3Cdiv%20id%3D%22editor%22%20contenteditable%3Dtrue%3E%3Chr%3Etest%3C%2Fdiv%3E%0A&ohh=1&ohj=1&jt=var%20div%20%3D%20document.getElementById('editor')%3B%0A%0A%2F%2F%20Change%20this%20to%20select%20a%20range%0AselectRange(div.childNodes%5B1%5D%2C%204%2C%20div.childNodes%5B1%5D%2C%204)%3B%0A%0A%2F%2F%20Change%20this%20to%20run%20execCommand%0Adocument.execCommand('FormatBlock'%2C%20false%2C%20'%3Ch1%3E')%3B%0A%0Afunction%20selectRange(startNode%2C%20startOffset%2C%20endNode%2C%20endOffset)%20%7B%0A%20%20var%20sel%20%3D%20window.getSelection()%3B%0A%20%20var%20range%20%3D%20null%3B%0A%20%20try%20%7B%0A%20%20%20%20range%20%3D%20sel.getRangeAt(0)%3B%0A%20%20%7D%20catch(ex)%20%7B%0A%20%20%20%20range%20%3D%20document.createRange()%3B%0A%20%20%7D%0A%20%20range.setStart(startNode%2C%20startOffset)%3B%0A%20%20range.setEnd(endNode%2C%20endOffset)%3B%0A%20%20sel.removeAllRanges()%3B%0A%20%20sel.addRange(range)%3B%0A%7D&ojh=1&ojj=1&ms=100&oth=0&otj=0&cex=1
Attachments
adds a test case
(2.24 KB, patch)
2010-03-09 14:49 PST
,
Ryosuke Niwa
darin
: review-
Details
Formatted Diff
Diff
fixed the test description
(2.13 KB, patch)
2010-03-09 18:52 PST
,
Ryosuke Niwa
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Tony Chang
Comment 1
2010-01-20 19:16:21 PST
The patch on
bug 32131
fixes this test as well. It's another case where we call applyStyle then restore the selection incorrectly. In this case, we're off by a character so the selection no longer contains the first letter after the HR tag.
Tony Chang
Comment 2
2010-03-08 21:09:04 PST
I think this bug is now fixed, but we should add a layout test so it doesn't regress.
Ryosuke Niwa
Comment 3
2010-03-09 14:49:40 PST
Created
attachment 50354
[details]
adds a test case We could make this a js test and add more test cases.
Darin Adler
Comment 4
2010-03-09 14:50:52 PST
Comment on
attachment 50354
[details]
adds a test case
> +This tests removing underline which is applied outside of unsplittable element. We shouldn't be removing underline.
Huh?
> +<p>This tests removing underline which is applied outside of unsplittable element. We shouldn't be removing underline.</p>
Wrong description here.
Ryosuke Niwa
Comment 5
2010-03-09 18:52:27 PST
Created
attachment 50364
[details]
fixed the test description (In reply to
comment #4
)
> (From update of
attachment 50354
[details]
) > > +<p>This tests removing underline which is applied outside of unsplittable element. We shouldn't be removing underline.</p> > > Wrong description here.
Sorry, I was too careless. Fixed.
Ryosuke Niwa
Comment 6
2010-03-10 10:28:34 PST
Comment on
attachment 50364
[details]
fixed the test description Added to the commit queue.
WebKit Commit Bot
Comment 7
2010-03-11 18:47:44 PST
Comment on
attachment 50364
[details]
fixed the test description Clearing flags on attachment: 50364 Committed
r55876
: <
http://trac.webkit.org/changeset/55876
>
WebKit Commit Bot
Comment 8
2010-03-11 18:47:49 PST
All reviewed patches have been landed. Closing bug.
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