Changeset 167845 in webkit


Ignore:
Timestamp:
Apr 26, 2014 2:28:20 PM (10 years ago)
Author:
Darin Adler
Message:

REGRESSION (r164133): Selection doesn't paint when scrolling some pages
https://bugs.webkit.org/show_bug.cgi?id=132172

Source/WebCore:
rdar://problem/16719473

Reviewed by Brent Fulgham.

Tests: fast/dynamic/remove-invisible-node-inside-selection.html

fast/dynamic/remove-node-inside-selection.html

  • editing/FrameSelection.cpp:

(WebCore::clearRenderViewSelection): Changed to take a Node& because having
this take a Position& was unnecessary and strange, when really it just needs
to take a document as an argument.
(WebCore::DragCaretController::nodeWillBeRemoved): Updated for the above.
(WebCore::FrameSelection::respondToNodeModification): Added code to set the
m_pendingSelectionUpdate flag and call RenderView::setNeedsLayout so the
selection will be recomputed after it's temporarily cleared when one of
the selected nodes is removed.

LayoutTests:

Reviewed by Brent Fulgham.

  • fast/dynamic/remove-invisible-node-inside-selection-expected.html: Added.
  • fast/dynamic/remove-invisible-node-inside-selection.html: Added.
  • fast/dynamic/remove-node-inside-selection-expected.html: Added.
  • fast/dynamic/remove-node-inside-selection.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r167840 r167845  
     12014-04-24  Darin Adler  <darin@apple.com>
     2
     3        REGRESSION (r164133): Selection doesn't paint when scrolling some pages
     4        https://bugs.webkit.org/show_bug.cgi?id=132172
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * fast/dynamic/remove-invisible-node-inside-selection-expected.html: Added.
     9        * fast/dynamic/remove-invisible-node-inside-selection.html: Added.
     10        * fast/dynamic/remove-node-inside-selection-expected.html: Added.
     11        * fast/dynamic/remove-node-inside-selection.html: Added.
     12
    1132014-04-25  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r167840 r167845  
     12014-04-24  Darin Adler  <darin@apple.com>
     2
     3        REGRESSION (r164133): Selection doesn't paint when scrolling some pages
     4        https://bugs.webkit.org/show_bug.cgi?id=132172
     5        rdar://problem/16719473
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Tests: fast/dynamic/remove-invisible-node-inside-selection.html
     10               fast/dynamic/remove-node-inside-selection.html
     11
     12        * editing/FrameSelection.cpp:
     13        (WebCore::clearRenderViewSelection): Changed to take a Node& because having
     14        this take a Position& was unnecessary and strange, when really it just needs
     15        to take a document as an argument.
     16        (WebCore::DragCaretController::nodeWillBeRemoved): Updated for the above.
     17        (WebCore::FrameSelection::respondToNodeModification): Added code to set the
     18        m_pendingSelectionUpdate flag and call RenderView::setNeedsLayout so the
     19        selection will be recomputed after it's temporarily cleared when one of
     20        the selected nodes is removed.
     21
    1222014-04-25  Ryosuke Niwa  <rniwa@webkit.org>
    223
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r167803 r167845  
    391391}
    392392
    393 static void clearRenderViewSelection(const Position& position)
    394 {
    395     Ref<Document> document(position.anchorNode()->document());
     393static void clearRenderViewSelection(Node& node)
     394{
     395    Ref<Document> document(node.document());
    396396    document->updateStyleIfNeeded();
    397397    if (RenderView* view = document->renderView())
     
    407407        return;
    408408
    409     clearRenderViewSelection(m_position.deepEquivalent());
     409    clearRenderViewSelection(*node);
    410410    clear();
    411411}
     
    465465    }
    466466
    467     if (clearRenderTreeSelection)
    468         clearRenderViewSelection(m_selection.start());
     467    if (clearRenderTreeSelection) {
     468        clearRenderViewSelection(*node);
     469
     470        // Trigger a selection update so the selection will be set again.
     471        if (auto* renderView = node->document().renderView()) {
     472            m_pendingSelectionUpdate = true;
     473            renderView->setNeedsLayout();
     474        }
     475    }
    469476
    470477    if (clearDOMTreeSelection)
Note: See TracChangeset for help on using the changeset viewer.