Changeset 168641 in webkit


Ignore:
Timestamp:
May 12, 2014 1:31:29 PM (10 years ago)
Author:
jhoneycutt@apple.com
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.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r168639 r168641  
     12014-05-09  Jon Honeycutt  <jhoneycutt@apple.com>
     2
     3        REGRESSION (r167818): editing/inserting/typing-space-to-trigger-smart-link.html fails on WebKit1 bots
     4
     5        <https://bugs.webkit.org/show_bug.cgi?id=132207>
     6        <rdar://problem/16730393>
     7
     8        Reviewed by Darin Adler.
     9
     10        * editing/apply-style-iframe-crash-expected.txt:
     11        Rebased test result has one fewer new line.
     12        * platform/mac-wk1/TestExpectations:
     13        Remove test from list of expected failures.
     14
    1152014-05-12  Alex Christensen  <achristensen@webkit.org>
    216
  • trunk/LayoutTests/editing/apply-style-iframe-crash-expected.txt

    r167818 r168641  
    1 
    21
    32
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r168616 r168641  
    1515
    1616webkit.org/b/124318 fullscreen/anonymous-block-merge-crash.html [ Pass Failure ]
    17 
    18 webkit.org/b/132207 editing/inserting/typing-space-to-trigger-smart-link.html [ Failure ]
    1917
    2018### END OF (1) Failures with bug reports
  • trunk/Source/WebCore/ChangeLog

    r168640 r168641  
     12014-05-09  Jon Honeycutt  <jhoneycutt@apple.com>
     2
     3        REGRESSION (r167818): editing/inserting/typing-space-to-trigger-smart-link.html fails on WebKit1 bots
     4
     5        <https://bugs.webkit.org/show_bug.cgi?id=132207>
     6        <rdar://problem/16730393>
     7
     8        Reverts the previous workaround in favor of a more specific fix for the
     9        null dereference.
     10
     11        Reviewed by Darin Adler.
     12
     13        * editing/ApplyStyleCommand.cpp:
     14        (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
     15        Check whether the run's start and end are still in the document, as
     16        removeConflictingInlineStyleFromRun() may have removed them.
     17
     18        * editing/CompositeEditCommand.cpp:
     19        (WebCore::CompositeEditCommand::apply):
     20        Reverted previous workaround.
     21        (WebCore::ApplyEditCommand::ReentrancyGuard::isRecursiveCall): Deleted.
     22        (WebCore::ApplyEditCommand::ReentrancyGuard::Scope::Scope): Deleted.
     23        (WebCore::ApplyEditCommand::ReentrancyGuard::Scope::~Scope): Deleted.
     24
    1252014-05-12  Zan Dobersek  <zdobersek@igalia.com>
    226
  • trunk/Source/WebCore/editing/ApplyStyleCommand.cpp

    r166150 r168641  
    813813    }
    814814
    815     for (size_t i = 0; i < runs.size(); i++) {
    816         removeConflictingInlineStyleFromRun(style, runs[i].start, runs[i].end, runs[i].pastEndNode);
    817         runs[i].positionForStyleComputation = positionToComputeInlineStyleChange(runs[i].start, runs[i].dummyElement);
     815    for (auto& run : runs) {
     816        removeConflictingInlineStyleFromRun(style, run.start, run.end, run.pastEndNode);
     817        if (run.startAndEndAreStillInDocument())
     818            run.positionForStyleComputation = positionToComputeInlineStyleChange(run.start, run.dummyElement);
    818819    }
    819820
  • trunk/Source/WebCore/editing/CompositeEditCommand.cpp

    r167818 r168641  
    8181using namespace HTMLNames;
    8282
    83 namespace ApplyEditCommand {
    84    
    85 class ReentrancyGuard {
    86 public:
    87     static bool isRecursiveCall() { return s_nestingCounter; }
    88 
    89     class Scope {
    90     public:
    91         Scope() { ++s_nestingCounter; }
    92         ~Scope() { --s_nestingCounter; }
    93     };
    94     friend class Scope;
    95 
    96 private:
    97     static unsigned s_nestingCounter;
    98 };
    99 unsigned ApplyEditCommand::ReentrancyGuard::s_nestingCounter;
    100    
    101 } // namespace ApplyEditCommand
    102 
    10383PassRefPtr<EditCommandComposition> EditCommandComposition::create(Document& document,
    10484    const VisibleSelection& startingSelection, const VisibleSelection& endingSelection, EditAction editAction)
     
    215195void CompositeEditCommand::apply()
    216196{
    217     // It's possible to enter this recursively, but legitimate cases of that are rare, and it can cause crashes. As a
    218     // temporary fix, guard against recursive calls.
    219     // FIXME: <rdar://16701803> Remove this workaround when <rdar://15797536> is fixed.
    220     if (ApplyEditCommand::ReentrancyGuard::isRecursiveCall())
    221         return;
    222 
    223197    if (!endingSelection().isContentRichlyEditable()) {
    224198        switch (editingAction()) {
     
    248222    {
    249223        EventQueueScope eventQueueScope;
    250         ApplyEditCommand::ReentrancyGuard::Scope reentrancyGuardScope;
    251224#if ENABLE(DELETION_UI)
    252225        DeleteButtonControllerDisableScope deleteButtonControllerDisableScope(&frame());
Note: See TracChangeset for help on using the changeset viewer.