[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 15:17:27 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1d836ce285da3d03d19b7fe60e159a7780a6460b
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 29 21:47:01 2010 +0000

    2010-10-29  Benjamin Kalman  <kalman at google.com>
    
            Reviewed by Tony Chang.
    
            Deleting contenteditable text to the left of a non-contenteditable span inserts unnecessary placeholder <br/>
            https://bugs.webkit.org/show_bug.cgi?id=48658
    
            * editing/deleting/5390681-expected.txt: Update test for changed behaviour.
            * editing/deleting/5390681.html: Ditto (update comment).
            * editing/deleting/delete-mixed-editable-content-001-expected.txt: Ditto.
            * editing/pasteboard/copy-backslash-with-euc-expected.txt: Ditto.
    2010-10-29  Benjamin Kalman  <kalman at google.com>
    
            Reviewed by Tony Chang.
    
            Deleting contenteditable text to the left of a non-contenteditable span inserts unnecessary placeholder <br/>
            https://bugs.webkit.org/show_bug.cgi?id=48658
    
            * WebCore.exp.in: Update is{Start,End}OfParagraph symbols.
            * editing/DeleteSelectionCommand.cpp:
            (WebCore::DeleteSelectionCommand::doApply): Cross editability boundaries when determining whether to insert placeholder.
            * editing/visible_units.cpp: Allow editability boundary to be crossed in {start,end,isStart,isEnd}OfParagraph.
            (WebCore::startOfParagraph): Also, avoid returning a position where renderer can't accept caret, like in endOfParagraph.
            (WebCore::endOfParagraph):
            (WebCore::isStartOfParagraph):
            (WebCore::isEndOfParagraph):
            * editing/visible_units.h: Ditto.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70932 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 2d5281f..54c00dd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-29  Benjamin Kalman  <kalman at google.com>
+
+        Reviewed by Tony Chang.
+
+        Deleting contenteditable text to the left of a non-contenteditable span inserts unnecessary placeholder <br/>
+        https://bugs.webkit.org/show_bug.cgi?id=48658
+
+        * editing/deleting/5390681-expected.txt: Update test for changed behaviour.
+        * editing/deleting/5390681.html: Ditto (update comment).
+        * editing/deleting/delete-mixed-editable-content-001-expected.txt: Ditto.
+        * editing/pasteboard/copy-backslash-with-euc-expected.txt: Ditto.
+
 2010-10-29  Eric Carlson  <eric.carlson at apple.com>
 
         Reviewed by Adam Roben.
diff --git a/LayoutTests/editing/deleting/5390681-expected.txt b/LayoutTests/editing/deleting/5390681-expected.txt
index 8977238..2329775 100644
--- a/LayoutTests/editing/deleting/5390681-expected.txt
+++ b/LayoutTests/editing/deleting/5390681-expected.txt
@@ -1,5 +1,4 @@
-This tests for a bug where expansion for smart delete would not consider editable boundaries.  Only 'foo' should be deleted.  You should see ' bar'.  There is a bug: while the non-editable space isn't deleted, deletion inserts a placeholder when it shouldn't.
-| <br>
+This tests for a bug where expansion for smart delete would not consider editable boundaries.  Only 'foo' should be deleted.  You should see ' bar'.
 | <span>
 |   contenteditable="false"
 |   " bar"
diff --git a/LayoutTests/editing/deleting/5390681.html b/LayoutTests/editing/deleting/5390681.html
index 5ce5276..68d603a 100644
--- a/LayoutTests/editing/deleting/5390681.html
+++ b/LayoutTests/editing/deleting/5390681.html
@@ -6,6 +6,6 @@ var sel = window.getSelection();
 sel.setPosition(div, 0);
 sel.modify("extend", "forward", "word");
 document.execCommand("Delete");
-Markup.description("This tests for a bug where expansion for smart delete would not consider editable boundaries.  Only 'foo' should be deleted.  You should see ' bar'.  There is a bug: while the non-editable space isn't deleted, deletion inserts a placeholder when it shouldn't.");
+Markup.description("This tests for a bug where expansion for smart delete would not consider editable boundaries.  Only 'foo' should be deleted.  You should see ' bar'.");
 Markup.dump(div);
 </script>
diff --git a/LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.txt b/LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.txt
index fc2d28f..196c677 100644
--- a/LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.txt
+++ b/LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.txt
@@ -14,7 +14,6 @@ Confirm no crash when selecting all text with mixed editability.
 |     contenteditable="true"
 |     id="test"
 |     <#selection-caret>
-|     <br>
 |   "
 "
 | "
diff --git a/LayoutTests/editing/pasteboard/copy-backslash-with-euc-expected.txt b/LayoutTests/editing/pasteboard/copy-backslash-with-euc-expected.txt
index 8c01c94..0f2e7a8 100644
--- a/LayoutTests/editing/pasteboard/copy-backslash-with-euc-expected.txt
+++ b/LayoutTests/editing/pasteboard/copy-backslash-with-euc-expected.txt
@@ -9,13 +9,10 @@ Texts in the EUC frame will be pasted here
 
 from EUC div to UTF8 text-control: 
 from EUC div to UTF8 content-editable: \ from EUC page
-
 from EUC transform to UTF8 text-control: 
 from EUC transform to UTF8 content-editable: \ FROM EUC PAGE (TRANSFORMED)
-
 from EUC secure to UTF8 text-control: 
 from EUC secure to UTF8 content-editable: ••••••••••••••••••••••••
-
 from EUC control to UTF8 text-control: 
 from EUC control to UTF8 content-editable: \ from EUC text control
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 57ba6ef..9276937 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-10-29  Benjamin Kalman  <kalman at google.com>
+
+        Reviewed by Tony Chang.
+
+        Deleting contenteditable text to the left of a non-contenteditable span inserts unnecessary placeholder <br/>
+        https://bugs.webkit.org/show_bug.cgi?id=48658
+
+        * WebCore.exp.in: Update is{Start,End}OfParagraph symbols.
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::doApply): Cross editability boundaries when determining whether to insert placeholder.
+        * editing/visible_units.cpp: Allow editability boundary to be crossed in {start,end,isStart,isEnd}OfParagraph.
+        (WebCore::startOfParagraph): Also, avoid returning a position where renderer can't accept caret, like in endOfParagraph.
+        (WebCore::endOfParagraph):
+        (WebCore::isStartOfParagraph):
+        (WebCore::isEndOfParagraph):
+        * editing/visible_units.h: Ditto.
+
 2010-10-29  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 39e6b36..66dc594 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -417,7 +417,7 @@ __ZN7WebCore16createFullMarkupEPKNS_4NodeE
 __ZN7WebCore16createFullMarkupEPKNS_5RangeE
 __ZN7WebCore16enclosingIntRectERK7_NSRect
 __ZN7WebCore16enclosingIntRectERKNS_9FloatRectE
-__ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionE
+__ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionENS_8Position27EditingBoundaryCrossingRuleE
 __ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERNS0_9WeakGCMapIPN3WTF10StringImplEPNS0_8JSStringEEES6_
 __ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE
 __ZN7WebCore17DOMImplementation13isXMLMIMETypeERKN3WTF6StringE
@@ -428,7 +428,7 @@ __ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
 __ZN7WebCore17nameForCursorTypeENS_6Cursor4TypeE
 __ZN7WebCore17openTemporaryFileEPKcRi
 __ZN7WebCore18SearchPopupMenuMacC1EPNS_15PopupMenuClientE
-__ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE
+__ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionENS_8Position27EditingBoundaryCrossingRuleE
 __ZN7WebCore18pluginScriptObjectEPN3JSC9ExecStateEPNS_13JSHTMLElementE
 __ZN7WebCore18proxyServersForURLERKNS_4KURLEPKNS_17NetworkingContextE
 __ZN7WebCore19AnimationController16resumeAnimationsEPNS_8DocumentE
diff --git a/WebCore/editing/DeleteSelectionCommand.cpp b/WebCore/editing/DeleteSelectionCommand.cpp
index 4aca57e..1f56da7 100644
--- a/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/WebCore/editing/DeleteSelectionCommand.cpp
@@ -756,9 +756,9 @@ void DeleteSelectionCommand::doApply()
     EAffinity affinity = m_selectionToDelete.affinity();
     
     Position downstreamEnd = m_selectionToDelete.end().downstream();
-    m_needPlaceholder = isStartOfParagraph(m_selectionToDelete.visibleStart()) &&
-                        isEndOfParagraph(m_selectionToDelete.visibleEnd()) &&
-                        !lineBreakExistsAtVisiblePosition(m_selectionToDelete.visibleEnd());
+    m_needPlaceholder = isStartOfParagraph(m_selectionToDelete.visibleStart(), Position::CanCrossEditingBoundary)
+            && isEndOfParagraph(m_selectionToDelete.visibleEnd(), Position::CanCrossEditingBoundary)
+            && !lineBreakExistsAtVisiblePosition(m_selectionToDelete.visibleEnd());
     if (m_needPlaceholder) {
         // Don't need a placeholder when deleting a selection that starts just before a table
         // and ends inside it (we do need placeholders to hold open empty cells, but that's
diff --git a/WebCore/editing/visible_units.cpp b/WebCore/editing/visible_units.cpp
index d9ca223..8b11013 100644
--- a/WebCore/editing/visible_units.cpp
+++ b/WebCore/editing/visible_units.cpp
@@ -29,6 +29,7 @@
 #include "Document.h"
 #include "Element.h"
 #include "HTMLNames.h"
+#include "Position.h"
 #include "RenderBlock.h"
 #include "RenderLayer.h"
 #include "RenderObject.h"
@@ -779,7 +780,7 @@ VisiblePosition nextSentencePosition(const VisiblePosition &c)
     return c.honorEditableBoundaryAtOrBefore(next);
 }
 
-VisiblePosition startOfParagraph(const VisiblePosition& c)
+VisiblePosition startOfParagraph(const VisiblePosition& c, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
 {
     Position p = c.deepEquivalent();
     Node *startNode = p.node();
@@ -797,7 +798,7 @@ VisiblePosition startOfParagraph(const VisiblePosition& c)
 
     Node *n = startNode;
     while (n) {
-        if (n->isContentEditable() != startNode->isContentEditable())
+        if (boundaryCrossingRule == Position::CannotCrossEditingBoundary && n->isContentEditable() != startNode->isContentEditable())
             break;
         RenderObject *r = n->renderer();
         if (!r) {
@@ -812,8 +813,8 @@ VisiblePosition startOfParagraph(const VisiblePosition& c)
         
         if (r->isBR() || isBlock(n))
             break;
-            
-        if (r->isText()) {
+
+        if (r->isText() && r->caretMaxRenderedOffset() > 0) {
             if (style->preserveNewline()) {
                 const UChar* chars = toRenderText(r)->characters();
                 int i = toRenderText(r)->textLength();
@@ -838,7 +839,7 @@ VisiblePosition startOfParagraph(const VisiblePosition& c)
     return VisiblePosition(node, offset, DOWNSTREAM);
 }
 
-VisiblePosition endOfParagraph(const VisiblePosition &c)
+VisiblePosition endOfParagraph(const VisiblePosition &c, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
 {    
     if (c.isNull())
         return VisiblePosition();
@@ -857,7 +858,7 @@ VisiblePosition endOfParagraph(const VisiblePosition &c)
 
     Node *n = startNode;
     while (n) {
-        if (n->isContentEditable() != startNode->isContentEditable())
+        if (boundaryCrossingRule == Position::CannotCrossEditingBoundary && n->isContentEditable() != startNode->isContentEditable())
             break;
         RenderObject *r = n->renderer();
         if (!r) {
@@ -872,9 +873,8 @@ VisiblePosition endOfParagraph(const VisiblePosition &c)
         
         if (r->isBR() || isBlock(n))
             break;
-            
+
         // FIXME: We avoid returning a position where the renderer can't accept the caret.
-        // We should probably do this in other cases such as startOfParagraph.
         if (r->isText() && r->caretMaxRenderedOffset() > 0) {
             int length = toRenderText(r)->textLength();
             if (style->preserveNewline()) {
@@ -914,14 +914,14 @@ bool inSameParagraph(const VisiblePosition &a, const VisiblePosition &b)
     return a.isNotNull() && startOfParagraph(a) == startOfParagraph(b);
 }
 
-bool isStartOfParagraph(const VisiblePosition &pos)
+bool isStartOfParagraph(const VisiblePosition &pos, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
 {
-    return pos.isNotNull() && pos == startOfParagraph(pos);
+    return pos.isNotNull() && pos == startOfParagraph(pos, boundaryCrossingRule);
 }
 
-bool isEndOfParagraph(const VisiblePosition &pos)
+bool isEndOfParagraph(const VisiblePosition &pos, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
 {
-    return pos.isNotNull() && pos == endOfParagraph(pos);
+    return pos.isNotNull() && pos == endOfParagraph(pos, boundaryCrossingRule);
 }
 
 VisiblePosition previousParagraphPosition(const VisiblePosition& p, int x)
diff --git a/WebCore/editing/visible_units.h b/WebCore/editing/visible_units.h
index a20b588..f78f9d1 100644
--- a/WebCore/editing/visible_units.h
+++ b/WebCore/editing/visible_units.h
@@ -27,6 +27,7 @@
 #define visible_units_h
 
 #include "Document.h"
+#include "Position.h"
 #include "TextAffinity.h"
 
 namespace WebCore {
@@ -60,14 +61,14 @@ VisiblePosition logicalStartOfLine(const VisiblePosition &);
 VisiblePosition logicalEndOfLine(const VisiblePosition &);
 
 // paragraphs (perhaps a misnomer, can be divided by line break elements)
-VisiblePosition startOfParagraph(const VisiblePosition&);
-VisiblePosition endOfParagraph(const VisiblePosition&);
+VisiblePosition startOfParagraph(const VisiblePosition&, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
+VisiblePosition endOfParagraph(const VisiblePosition&, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
 VisiblePosition startOfNextParagraph(const VisiblePosition&);
 VisiblePosition previousParagraphPosition(const VisiblePosition &, int x);
 VisiblePosition nextParagraphPosition(const VisiblePosition &, int x);
+bool isStartOfParagraph(const VisiblePosition &, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
+bool isEndOfParagraph(const VisiblePosition &, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
 bool inSameParagraph(const VisiblePosition &, const VisiblePosition &);
-bool isStartOfParagraph(const VisiblePosition &);
-bool isEndOfParagraph(const VisiblePosition &);
 
 // blocks (true paragraphs; line break elements don't break blocks)
 VisiblePosition startOfBlock(const VisiblePosition &);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list