Title: [170655] trunk/Source/WebCore
Revision
170655
Author
mmaxfi...@apple.com
Date
2014-07-01 12:10:30 -0700 (Tue, 01 Jul 2014)

Log Message

Typing an automatic text replacement phrase after a br in contenteditable is not rendered as expected
https://bugs.webkit.org/show_bug.cgi?id=133883

Reviewed by Enrica Casucci.

enclosingDeletableElement() makes sure that the element's container is editable, but not
that it is capable of having content inside it (like how a <br> can't).

No new tests. I don't think this is testable because it requires setting some state in System Preferences.

* editing/DeleteButtonController.cpp:
(WebCore::enclosingDeletableElement):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (170654 => 170655)


--- trunk/Source/WebCore/ChangeLog	2014-07-01 19:04:54 UTC (rev 170654)
+++ trunk/Source/WebCore/ChangeLog	2014-07-01 19:10:30 UTC (rev 170655)
@@ -1,3 +1,18 @@
+2014-07-01  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Typing an automatic text replacement phrase after a br in contenteditable is not rendered as expected
+        https://bugs.webkit.org/show_bug.cgi?id=133883
+
+        Reviewed by Enrica Casucci.
+
+        enclosingDeletableElement() makes sure that the element's container is editable, but not
+        that it is capable of having content inside it (like how a <br> can't).
+
+        No new tests. I don't think this is testable because it requires setting some state in System Preferences.
+
+        * editing/DeleteButtonController.cpp:
+        (WebCore::enclosingDeletableElement):
+
 2014-07-01  Alex Christensen  <achristen...@webkit.org>
 
         [iOS] Unreviewed build fix after r170640.

Modified: trunk/Source/WebCore/editing/DeleteButtonController.cpp (170654 => 170655)


--- trunk/Source/WebCore/editing/DeleteButtonController.cpp	2014-07-01 19:04:54 UTC (rev 170654)
+++ trunk/Source/WebCore/editing/DeleteButtonController.cpp	2014-07-01 19:10:30 UTC (rev 170655)
@@ -145,18 +145,18 @@
 
     RefPtr<Range> range = selection.toNormalizedRange();
     if (!range)
-        return 0;
+        return nullptr;
 
     Node* container = range->commonAncestorContainer(ASSERT_NO_EXCEPTION);
     ASSERT(container);
 
     // The enclosingNodeOfType function only works on nodes that are editable
-    // (which is strange, given its name).
-    if (!container->hasEditableStyle())
-        return 0;
+    // and capable of having editing positions inside them (which is strange, given its name).
+    if (!container->hasEditableStyle() || editingIgnoresContent(container))
+        return nullptr;
 
     Node* element = enclosingNodeOfType(firstPositionInNode(container), &isDeletableElement);
-    return element && element->isHTMLElement() ? toHTMLElement(element) : 0;
+    return element && element->isHTMLElement() ? toHTMLElement(element) : nullptr;
 }
 
 void DeleteButtonController::respondToChangedSelection(const VisibleSelection& oldSelection)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to