Bug 43447 - Outdent moves text before other text
Summary: Outdent moves text before other text
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-03 15:00 PDT by Julie Parent
Modified: 2022-11-22 02:32 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julie Parent 2010-08-03 15:00:11 PDT
Repro steps:
1. Start with the following HTML inside an editable region:
<blockquote>one&nbsp;<font color="#FF0000" id='font'>two<br>three</font></blockquote>
2. Select "three"
3. execCommand('outdent')

Result:
"three" moves BEFORE "one two" and "e two" is selected.  HTML is:
<span class="Apple-style-span" style="color: rgb(255, 0, 0); ">three</span><br><blockquote>one&nbsp;<font color="#FF0000" id="font">two<br></font></blockquote>

Expected Result:
"three" stays after "one two", "three" remains selected, "three" is no longer indented

Demo here (click eval js to execute the select and execCommand): http://plexode.com/eval3/#ht=%3Cdiv%20contentEditable%3E%0A%3Cblockquote%3Eone%26nbsp%3B%3Cfont%20color%3D%22%23FF0000%22%20id%3D'font'%3Etwo%3Cbr%3Ethree%3C%2Ffont%3E%3C%2Fblockquote%3E%0A%3C%2Fdiv%3E&ohh=1&ohj=1&jt=document.getSelection().setBaseAndExtent(font.lastChild%2C%200%2C%20font.lastChild%2C%20font.lastChild.length)%3B%0Adocument.execCommand('outdent'%2C%20false%2C%20null)%3B%0A&ojh=0&ojj=0&ms=100&oth=0&otj=0&cex=1

Discovered in Google Sites.
Comment 1 Aryeh Gregor 2011-08-18 13:25:17 PDT
More minimal test case:

  <blockquote><span>foo<br>[bar]</span></blockquote>
Comment 2 Ahmad Saleem 2022-11-22 02:32:16 PST
Using test case from Comment 01, I am not able to reproduce this bug but using plexode from Comment 0, these are results:

*** Chrome Canary 110 & Safari 16.1 / STP 158 ***

One
Three (RED)
TWO (RED)

*** Firefox Nightly 109 ***

One TWO (RED)
Three (RED)

___

Just wanted to share updated results. Thanks!