Title: [168641] trunk
Revision
168641
Author
[email protected]
Date
2014-05-12 13:31:29 -0700 (Mon, 12 May 2014)

Log Message

REGRESSION (r167818): editing/inserting/typing-space-to-trigger-smart-link.html fails on WebKit1 bots

<https://bugs.webkit.org/show_bug.cgi?id=132207>
<rdar://problem/16730393>

Source/WebCore:
Reverts the previous workaround in favor of a more specific fix for the
null dereference.

Reviewed by Darin Adler.

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
Check whether the run's start and end are still in the document, as
removeConflictingInlineStyleFromRun() may have removed them.

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
Reverted previous workaround.
(WebCore::ApplyEditCommand::ReentrancyGuard::isRecursiveCall): Deleted.
(WebCore::ApplyEditCommand::ReentrancyGuard::Scope::Scope): Deleted.
(WebCore::ApplyEditCommand::ReentrancyGuard::Scope::~Scope): Deleted.

LayoutTests:
Reviewed by Darin Adler.

* editing/apply-style-iframe-crash-expected.txt:
Rebased test result has one fewer new line.
* platform/mac-wk1/TestExpectations:
Remove test from list of expected failures.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (168640 => 168641)


--- trunk/LayoutTests/ChangeLog	2014-05-12 20:16:43 UTC (rev 168640)
+++ trunk/LayoutTests/ChangeLog	2014-05-12 20:31:29 UTC (rev 168641)
@@ -1,3 +1,17 @@
+2014-05-09  Jon Honeycutt  <[email protected]>
+
+        REGRESSION (r167818): editing/inserting/typing-space-to-trigger-smart-link.html fails on WebKit1 bots
+
+        <https://bugs.webkit.org/show_bug.cgi?id=132207>
+        <rdar://problem/16730393>
+
+        Reviewed by Darin Adler.
+
+        * editing/apply-style-iframe-crash-expected.txt:
+        Rebased test result has one fewer new line.
+        * platform/mac-wk1/TestExpectations:
+        Remove test from list of expected failures.
+
 2014-05-12  Alex Christensen  <[email protected]>
 
         Implement EXT_shader_texture_lod in WebGL.

Modified: trunk/LayoutTests/editing/apply-style-iframe-crash-expected.txt (168640 => 168641)


--- trunk/LayoutTests/editing/apply-style-iframe-crash-expected.txt	2014-05-12 20:16:43 UTC (rev 168640)
+++ trunk/LayoutTests/editing/apply-style-iframe-crash-expected.txt	2014-05-12 20:31:29 UTC (rev 168641)
@@ -1,5 +1,4 @@
 
 
-
 PASS
 WebKit bug #132103: Crash applying editing commands from iframe onload event.

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (168640 => 168641)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2014-05-12 20:16:43 UTC (rev 168640)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2014-05-12 20:31:29 UTC (rev 168641)
@@ -15,8 +15,6 @@
 
 webkit.org/b/124318 fullscreen/anonymous-block-merge-crash.html [ Pass Failure ]
 
-webkit.org/b/132207 editing/inserting/typing-space-to-trigger-smart-link.html [ Failure ]
-
 ### END OF (1) Failures with bug reports
 ########################################
 

Modified: trunk/Source/WebCore/ChangeLog (168640 => 168641)


--- trunk/Source/WebCore/ChangeLog	2014-05-12 20:16:43 UTC (rev 168640)
+++ trunk/Source/WebCore/ChangeLog	2014-05-12 20:31:29 UTC (rev 168641)
@@ -1,3 +1,27 @@
+2014-05-09  Jon Honeycutt  <[email protected]>
+
+        REGRESSION (r167818): editing/inserting/typing-space-to-trigger-smart-link.html fails on WebKit1 bots
+
+        <https://bugs.webkit.org/show_bug.cgi?id=132207>
+        <rdar://problem/16730393>
+
+        Reverts the previous workaround in favor of a more specific fix for the
+        null dereference.
+
+        Reviewed by Darin Adler.
+
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
+        Check whether the run's start and end are still in the document, as
+        removeConflictingInlineStyleFromRun() may have removed them.
+
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::apply):
+        Reverted previous workaround.
+        (WebCore::ApplyEditCommand::ReentrancyGuard::isRecursiveCall): Deleted.
+        (WebCore::ApplyEditCommand::ReentrancyGuard::Scope::Scope): Deleted.
+        (WebCore::ApplyEditCommand::ReentrancyGuard::Scope::~Scope): Deleted.
+
 2014-05-12  Zan Dobersek  <[email protected]>
 
         Clean up CrossThreadTask

Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (168640 => 168641)


--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp	2014-05-12 20:16:43 UTC (rev 168640)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp	2014-05-12 20:31:29 UTC (rev 168641)
@@ -812,9 +812,10 @@
         runs.append(InlineRunToApplyStyle(runStart, runEnd, pastEndNode));
     }
 
-    for (size_t i = 0; i < runs.size(); i++) {
-        removeConflictingInlineStyleFromRun(style, runs[i].start, runs[i].end, runs[i].pastEndNode);
-        runs[i].positionForStyleComputation = positionToComputeInlineStyleChange(runs[i].start, runs[i].dummyElement);
+    for (auto& run : runs) {
+        removeConflictingInlineStyleFromRun(style, run.start, run.end, run.pastEndNode);
+        if (run.startAndEndAreStillInDocument())
+            run.positionForStyleComputation = positionToComputeInlineStyleChange(run.start, run.dummyElement);
     }
 
     document().updateLayoutIgnorePendingStylesheets();

Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (168640 => 168641)


--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp	2014-05-12 20:16:43 UTC (rev 168640)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp	2014-05-12 20:31:29 UTC (rev 168641)
@@ -80,26 +80,6 @@
 
 using namespace HTMLNames;
 
-namespace ApplyEditCommand {
-    
-class ReentrancyGuard {
-public:
-    static bool isRecursiveCall() { return s_nestingCounter; }
-
-    class Scope {
-    public:
-        Scope() { ++s_nestingCounter; }
-        ~Scope() { --s_nestingCounter; }
-    };
-    friend class Scope;
-
-private:
-    static unsigned s_nestingCounter;
-};
-unsigned ApplyEditCommand::ReentrancyGuard::s_nestingCounter;
-    
-} // namespace ApplyEditCommand
-
 PassRefPtr<EditCommandComposition> EditCommandComposition::create(Document& document,
     const VisibleSelection& startingSelection, const VisibleSelection& endingSelection, EditAction editAction)
 {
@@ -214,12 +194,6 @@
 
 void CompositeEditCommand::apply()
 {
-    // It's possible to enter this recursively, but legitimate cases of that are rare, and it can cause crashes. As a
-    // temporary fix, guard against recursive calls.
-    // FIXME: <rdar://16701803> Remove this workaround when <rdar://15797536> is fixed.
-    if (ApplyEditCommand::ReentrancyGuard::isRecursiveCall())
-        return;
-
     if (!endingSelection().isContentRichlyEditable()) {
         switch (editingAction()) {
         case EditActionTyping:
@@ -247,7 +221,6 @@
 
     {
         EventQueueScope eventQueueScope;
-        ApplyEditCommand::ReentrancyGuard::Scope reentrancyGuardScope;
 #if ENABLE(DELETION_UI)
         DeleteButtonControllerDisableScope deleteButtonControllerDisableScope(&frame());
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to