Changeset 163920 in webkit


Ignore:
Timestamp:
Feb 11, 2014 5:53:03 PM (10 years ago)
Author:
rniwa@webkit.org
Message:

Frame::rectForSelection shouldn't instantiate FrameSelection
https://bugs.webkit.org/show_bug.cgi?id=128587

Reviewed by Enrica Casucci.

Source/WebCore:

Made VisiblePosition::absoluteCaretBounds more interoperable with the one in FrameSelection and made
iOS's Frame::rectForScrollToVisible use that function instead.

The above change allows us to remove:

  • suppressCloseTyping(), restoreCloseTyping(), and m_closeTypingSuppressions in FrameSelection
  • suppressSelectionNotifications() and restoreSelectionNotifications() in EditorClient

See inline comments below for more details.

  • Source/WebCore/WebCore.exp.in:
  • editing/FrameSelection.cpp:

(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
(WebCore::CaretBase::updateCaretRect):
(WebCore::FrameSelection::caretRendererWithoutUpdatingLayout):
(WebCore::DragCaretController::caretRenderer):
(WebCore::repaintCaretForLocalRect):
(WebCore::FrameSelection::recomputeCaretRect): Merged FrameSelection::localCaretRect(). Modified
the code to update caretNode when and only when caret rect is updated. Also added an assertion to
ensure absoluteCaretBounds() on FrameSelection and VisiblePosition yield the same result.

(WebCore::CaretBase::paintCaret):

  • editing/FrameSelection.h:
  • editing/VisiblePosition.cpp:

(WebCore::VisiblePosition::absoluteCaretBounds): Fixed the bug where the old code wasn't respecting
the convention to use containing block as the renderer to paint caret.

  • editing/htmlediting.cpp:

(WebCore::caretRendersInsideNode): Moved from FrameSelection.cpp.
(WebCore::rendererForCaretPainting): Ditto and renamed from caretRenderer.
(WebCore::localCaretRectInRendererForCaretPainting): Extracted from FrameSelection::updateCaretRect.
(WebCore::absoluteBoundsForLocalCaretRect): Ditto from CaretBase::absoluteBoundsForLocalRect.

  • editing/htmlediting.h:
  • loader/EmptyClients.h:
  • page/EditorClient.h:
  • page/Frame.h:
  • page/ios/FrameIOS.mm:

(WebCore::Frame::rectForScrollToVisible): Reimplemented in its simplest form using VisiblePosition's
absoluteCaretBounds().

Source/WebKit/mac:

  • WebCoreSupport/WebEditorClient.h:
  • WebCoreSupport/WebEditorClient.mm:

(WebEditorClient::WebEditorClient):
(WebEditorClient::respondToChangedSelection):

Source/WebKit2:

  • WebProcess/WebCoreSupport/WebEditorClient.h:
  • WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
Location:
trunk/Source
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r163919 r163920  
     12014-02-11  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Frame::rectForSelection shouldn't instantiate FrameSelection
     4        https://bugs.webkit.org/show_bug.cgi?id=128587
     5
     6        Reviewed by Enrica Casucci.
     7
     8        Made VisiblePosition::absoluteCaretBounds more interoperable with the one in FrameSelection and made
     9        iOS's Frame::rectForScrollToVisible use that function instead.
     10
     11        The above change allows us to remove:
     12        - suppressCloseTyping(), restoreCloseTyping(), and m_closeTypingSuppressions in FrameSelection
     13        - suppressSelectionNotifications() and restoreSelectionNotifications() in EditorClient
     14
     15        See inline comments below for more details.
     16
     17        * Source/WebCore/WebCore.exp.in:
     18
     19        * editing/FrameSelection.cpp:
     20        (WebCore::FrameSelection::FrameSelection):
     21        (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
     22        (WebCore::CaretBase::updateCaretRect):
     23        (WebCore::FrameSelection::caretRendererWithoutUpdatingLayout):
     24        (WebCore::DragCaretController::caretRenderer):
     25        (WebCore::repaintCaretForLocalRect):
     26        (WebCore::FrameSelection::recomputeCaretRect): Merged FrameSelection::localCaretRect(). Modified
     27        the code to update caretNode when and only when caret rect is updated. Also added an assertion to
     28        ensure absoluteCaretBounds() on FrameSelection and VisiblePosition yield the same result.
     29
     30        (WebCore::CaretBase::paintCaret):
     31        * editing/FrameSelection.h:
     32
     33        * editing/VisiblePosition.cpp:
     34        (WebCore::VisiblePosition::absoluteCaretBounds): Fixed the bug where the old code wasn't respecting
     35        the convention to use containing block as the renderer to paint caret.
     36
     37        * editing/htmlediting.cpp:
     38        (WebCore::caretRendersInsideNode): Moved from FrameSelection.cpp.
     39        (WebCore::rendererForCaretPainting): Ditto and renamed from caretRenderer.
     40        (WebCore::localCaretRectInRendererForCaretPainting): Extracted from FrameSelection::updateCaretRect.
     41        (WebCore::absoluteBoundsForLocalCaretRect): Ditto from CaretBase::absoluteBoundsForLocalRect.
     42        * editing/htmlediting.h:
     43
     44        * loader/EmptyClients.h:
     45        * page/EditorClient.h:
     46        * page/Frame.h:
     47
     48        * page/ios/FrameIOS.mm:
     49        (WebCore::Frame::rectForScrollToVisible): Reimplemented in its simplest form using VisiblePosition's
     50        absoluteCaretBounds().
     51
    1522014-02-11  Enrica Casucci  <enrica@apple.com>
    253
  • trunk/Source/WebCore/WebCore.exp.in

    r163919 r163920  
    25382538__ZNK7WebCore5Frame15innerLineHeightEP7DOMNode
    25392539__ZNK7WebCore5Frame15preferredHeightEv
    2540 __ZNK7WebCore5Frame16rectForSelectionERNS_16VisibleSelectionE
    25412540__ZNK7WebCore5Frame18renderRectForPointE7CGPointPbPf
    25422541__ZNK7WebCore5Frame19rangedSelectionBaseEv
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r163739 r163920  
    120120    , m_updateAppearanceEnabled(false)
    121121    , m_caretBlinks(true)
    122     , m_closeTypingSuppressions(0)
    123122    , m_scrollingSuppressCount(0)
    124123#endif
     
    279278    m_granularity = granularity;
    280279
    281 #if PLATFORM(IOS)
    282     if (closeTyping && m_closeTypingSuppressions == 0)
    283 #else
    284280    if (closeTyping)
    285 #endif
    286281        TypingCommand::closeTyping(m_frame);
    287282
     
    12881283}
    12891284
    1290 static inline bool caretRendersInsideNode(Node* node)
    1291 {
    1292     return node && !isRenderedTable(node) && !editingIgnoresContent(node);
    1293 }
    1294 
    1295 static RenderObject* caretRenderer(Node* node)
    1296 {
    1297     if (!node)
    1298         return 0;
    1299 
    1300     RenderObject* renderer = node->renderer();
    1301     if (!renderer)
    1302         return 0;
    1303 
    1304     // if caretNode is a block and caret is inside it then caret should be painted by that block
    1305     bool paintedByBlock = renderer->isRenderBlockFlow() && caretRendersInsideNode(node);
    1306     return paintedByBlock ? renderer : renderer->containingBlock();
    1307 }
    1308 
    13091285bool CaretBase::updateCaretRect(Document* document, const VisiblePosition& caretPosition)
    13101286{
    13111287    document->updateLayoutIgnorePendingStylesheets();
    1312     m_caretLocalRect = LayoutRect();
    1313 
    13141288    m_caretRectNeedsUpdate = false;
    1315 
    1316     if (caretPosition.isNull())
    1317         return false;
    1318 
    1319     ASSERT(caretPosition.deepEquivalent().deprecatedNode()->renderer());
    1320 
    1321     // First compute a rect local to the renderer at the selection start.
    13221289    RenderObject* renderer;
    1323     LayoutRect localRect = caretPosition.localCaretRect(renderer);
    1324 
    1325     // Get the renderer that will be responsible for painting the caret
    1326     // (which is either the renderer we just found, or one of its containers).
    1327     RenderObject* caretPainter = caretRenderer(caretPosition.deepEquivalent().deprecatedNode());
    1328 
    1329     // Compute an offset between the renderer and the caretPainter.
    1330     bool unrooted = false;
    1331     while (renderer != caretPainter) {
    1332         RenderObject* containerObject = renderer->container();
    1333         if (!containerObject) {
    1334             unrooted = true;
    1335             break;
    1336         }
    1337         localRect.move(renderer->offsetFromContainer(containerObject, localRect.location()));
    1338         renderer = containerObject;
    1339     }
    1340 
    1341     if (!unrooted)
    1342         m_caretLocalRect = localRect;
    1343 
    1344     return true;
     1290    m_caretLocalRect = localCaretRectInRendererForCaretPainting(caretPosition, renderer);
     1291    return !m_caretLocalRect.isEmpty();
    13451292}
    13461293
    13471294RenderObject* FrameSelection::caretRendererWithoutUpdatingLayout() const
    13481295{
    1349     return WebCore::caretRenderer(m_selection.start().deprecatedNode());
     1296    return rendererForCaretPainting(m_selection.start().deprecatedNode());
    13501297}
    13511298
    13521299RenderObject* DragCaretController::caretRenderer() const
    13531300{
    1354     return WebCore::caretRenderer(m_position.deepEquivalent().deprecatedNode());
     1301    return rendererForCaretPainting(m_position.deepEquivalent().deprecatedNode());
    13551302}
    13561303
     
    13601307}
    13611308
    1362 LayoutRect FrameSelection::localCaretRect()
    1363 {
     1309IntRect FrameSelection::absoluteCaretBounds()
     1310{
     1311    recomputeCaretRect();
     1312    return m_absCaretBounds;
     1313}
     1314
     1315static void repaintCaretForLocalRect(Node* node, const LayoutRect& rect)
     1316{
     1317    RenderObject* caretPainter = rendererForCaretPainting(node);
     1318    if (!caretPainter)
     1319        return;
     1320
     1321    caretPainter->repaintRectangle(rect);
     1322}
     1323
     1324bool FrameSelection::recomputeCaretRect()
     1325{
     1326    if (!shouldUpdateCaretRect())
     1327        return false;
     1328
     1329    if (!m_frame)
     1330        return false;
     1331
     1332    FrameView* v = m_frame->document()->view();
     1333    if (!v)
     1334        return false;
     1335
     1336    LayoutRect oldRect = localCaretRectWithoutUpdate();
     1337
     1338    RefPtr<Node> caretNode = m_previousCaretNode;
    13641339    if (shouldUpdateCaretRect()) {
    13651340        if (!isNonOrphanedCaret(m_selection))
    13661341            clearCaretRect();
    1367         else if (updateCaretRect(m_frame->document(), VisiblePosition(m_selection.start(), m_selection.affinity())))
    1368             m_absCaretBoundsDirty = true;
    1369     }
    1370 
    1371     return localCaretRectWithoutUpdate();
    1372 }
    1373 
    1374 IntRect CaretBase::absoluteBoundsForLocalRect(Node* node, const LayoutRect& rect) const
    1375 {
    1376     RenderObject* caretPainter = caretRenderer(node);
    1377     if (!caretPainter)
    1378         return IntRect();
    1379    
    1380     LayoutRect localRect(rect);
    1381     if (caretPainter->isBox())
    1382         toRenderBox(caretPainter)->flipForWritingMode(localRect);
    1383     return caretPainter->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
    1384 }
    1385 
    1386 IntRect FrameSelection::absoluteCaretBounds()
    1387 {
    1388     recomputeCaretRect();
    1389     return m_absCaretBounds;
    1390 }
    1391 
    1392 static void repaintCaretForLocalRect(Node* node, const LayoutRect& rect)
    1393 {
    1394     RenderObject* caretPainter = caretRenderer(node);
    1395     if (!caretPainter)
    1396         return;
    1397 
    1398     caretPainter->repaintRectangle(rect);
    1399 }
    1400 
    1401 bool FrameSelection::recomputeCaretRect()
    1402 {
    1403     if (!shouldUpdateCaretRect())
    1404         return false;
    1405 
    1406     if (!m_frame)
    1407         return false;
    1408 
    1409     FrameView* v = m_frame->document()->view();
    1410     if (!v)
    1411         return false;
    1412 
    1413     Node* caretNode = m_selection.start().deprecatedNode();
    1414 
    1415     LayoutRect oldRect = localCaretRectWithoutUpdate();
    1416     LayoutRect newRect = localCaretRect();
     1342        else {
     1343            VisiblePosition visibleStart = m_selection.visibleStart();
     1344            if (updateCaretRect(m_frame->document(), visibleStart)) {
     1345                caretNode = visibleStart.deepEquivalent().deprecatedNode();
     1346                m_absCaretBoundsDirty = true;
     1347            }
     1348        }
     1349    }
     1350    LayoutRect newRect = localCaretRectWithoutUpdate();
    14171351
    14181352    if (caretNode == m_previousCaretNode && oldRect == newRect && !m_absCaretBoundsDirty)
     
    14201354
    14211355    IntRect oldAbsCaretBounds = m_absCaretBounds;
    1422     m_absCaretBounds = absoluteBoundsForLocalRect(caretNode, localCaretRectWithoutUpdate());
     1356    m_absCaretBounds = absoluteBoundsForLocalCaretRect(rendererForCaretPainting(caretNode.get()), newRect);
     1357
     1358    if (m_absCaretBoundsDirty) // We should be able to always assert this condition.
     1359        ASSERT(m_absCaretBounds == m_selection.visibleStart().absoluteCaretBounds());
     1360
    14231361    m_absCaretBoundsDirty = false;
    14241362
     
    14331371                repaintCaretForLocalRect(m_previousCaretNode.get(), oldRect);
    14341372            m_previousCaretNode = caretNode;
    1435             repaintCaretForLocalRect(caretNode, newRect);
     1373            repaintCaretForLocalRect(caretNode.get(), newRect);
    14361374        }
    14371375    }
     
    14931431
    14941432    LayoutRect drawingRect = localCaretRectWithoutUpdate();
    1495     RenderObject* renderer = caretRenderer(node);
     1433    RenderObject* renderer = rendererForCaretPainting(node);
    14961434    if (renderer && renderer->isBox())
    14971435        toRenderBox(renderer)->flipForWritingMode(drawingRect);
  • trunk/Source/WebCore/editing/FrameSelection.h

    r163739 r163920  
    6969    void clearCaretRect();
    7070    bool updateCaretRect(Document*, const VisiblePosition& caretPosition);
    71     IntRect absoluteBoundsForLocalRect(Node*, const LayoutRect&) const;
    7271    bool shouldRepaintCaret(const RenderView*, bool isContentEditable) const;
    7372    void paintCaret(Node*, GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect) const;
     
    169168    RenderObject* caretRendererWithoutUpdatingLayout() const;
    170169
    171     // Caret rect local to the caret's renderer
    172     LayoutRect localCaretRect();
    173 
    174170    // Bounds of (possibly transformed) caret in absolute coords
    175171    IntRect absoluteCaretBounds();
     
    230226    PassRefPtr<Range> rangeByExtendingCurrentSelection(int amount) const;
    231227    void selectRangeOnElement(unsigned location, unsigned length, Node*);
    232     void suppressCloseTyping() { ++m_closeTypingSuppressions; }
    233     void restoreCloseTyping() { --m_closeTypingSuppressions; }
    234228    void clearCurrentSelection();
    235229    void setCaretBlinks(bool caretBlinks = true);
     
    343337    bool m_caretBlinks : 1;
    344338    Color m_caretColor;
    345     int m_closeTypingSuppressions;
    346339    int m_scrollingSuppressCount;
    347340#endif
  • trunk/Source/WebCore/editing/VisiblePosition.cpp

    r161851 r163920  
    620620IntRect VisiblePosition::absoluteCaretBounds() const
    621621{
    622     RenderObject* renderer;
    623     LayoutRect localRect = localCaretRect(renderer);
    624     if (localRect.isEmpty() || !renderer)
    625         return IntRect();
    626 
    627     return renderer->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
     622    RenderObject* renderer = nullptr;
     623    LayoutRect localRect = localCaretRectInRendererForCaretPainting(*this, renderer);
     624    return absoluteBoundsForLocalCaretRect(renderer, localRect);
    628625}
    629626
  • trunk/Source/WebCore/editing/htmlediting.cpp

    r163617 r163920  
    4646#include "NodeTraversal.h"
    4747#include "PositionIterator.h"
     48#include "RenderBlock.h"
    4849#include "RenderElement.h"
    4950#include "ShadowRoot.h"
     
    12611262}
    12621263
     1264static inline bool caretRendersInsideNode(Node* node)
     1265{
     1266    return node && !isRenderedTable(node) && !editingIgnoresContent(node);
     1267}
     1268
     1269RenderObject* rendererForCaretPainting(Node* node)
     1270{
     1271    if (!node)
     1272        return 0;
     1273
     1274    RenderObject* renderer = node->renderer();
     1275    if (!renderer)
     1276        return 0;
     1277
     1278    // If caretNode is a block and caret is inside it, then caret should be painted by that block.
     1279    bool paintedByBlock = renderer->isRenderBlockFlow() && caretRendersInsideNode(node);
     1280    return paintedByBlock ? renderer : renderer->containingBlock();
     1281}
     1282
     1283LayoutRect localCaretRectInRendererForCaretPainting(const VisiblePosition& caretPosition, RenderObject*& caretPainter)
     1284{
     1285    if (caretPosition.isNull())
     1286        return LayoutRect();
     1287
     1288    ASSERT(caretPosition.deepEquivalent().deprecatedNode()->renderer());
     1289
     1290    // First compute a rect local to the renderer at the selection start.
     1291    RenderObject* renderer;
     1292    LayoutRect localRect = caretPosition.localCaretRect(renderer);
     1293
     1294    // Get the renderer that will be responsible for painting the caret
     1295    // (which is either the renderer we just found, or one of its containers).
     1296    caretPainter = rendererForCaretPainting(caretPosition.deepEquivalent().deprecatedNode());
     1297
     1298    // Compute an offset between the renderer and the caretPainter.
     1299    while (renderer != caretPainter) {
     1300        RenderObject* containerObject = renderer->container();
     1301        if (!containerObject)
     1302            return LayoutRect();
     1303        localRect.move(renderer->offsetFromContainer(containerObject, localRect.location()));
     1304        renderer = containerObject;
     1305    }
     1306
     1307    return localRect;
     1308}
     1309
     1310IntRect absoluteBoundsForLocalCaretRect(RenderObject* rendererForCaretPainting, const LayoutRect& rect)
     1311{
     1312    if (!rendererForCaretPainting || rect.isEmpty())
     1313        return IntRect();
     1314
     1315    LayoutRect localRect(rect);
     1316    if (rendererForCaretPainting->isBox())
     1317        toRenderBox(rendererForCaretPainting)->flipForWritingMode(localRect);
     1318    return rendererForCaretPainting->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
     1319}
     1320
    12631321} // namespace WebCore
  • trunk/Source/WebCore/editing/htmlediting.h

    r163617 r163920  
    257257const String& nonBreakingSpaceString();
    258258
     259// Miscellaaneous functions that for caret rendering
     260
     261RenderObject* rendererForCaretPainting(Node*);
     262LayoutRect localCaretRectInRendererForCaretPainting(const VisiblePosition&, RenderObject*&);
     263IntRect absoluteBoundsForLocalCaretRect(RenderObject* rendererForCaretPainting, const LayoutRect&);
     264
    259265}
    260266
  • trunk/Source/WebCore/loader/EmptyClients.h

    r163725 r163920  
    471471
    472472#if PLATFORM(IOS)
    473     virtual void suppressSelectionNotifications() override { }
    474     virtual void restoreSelectionNotifications() override { }
    475473    virtual void startDelayingAndCoalescingContentChangeNotifications() override { }
    476474    virtual void stopDelayingAndCoalescingContentChangeNotifications() override { }
  • trunk/Source/WebCore/page/EditorClient.h

    r163725 r163920  
    120120
    121121#if PLATFORM(IOS)
    122     virtual void suppressSelectionNotifications() = 0;
    123     virtual void restoreSelectionNotifications() = 0;
    124122    virtual void startDelayingAndCoalescingContentChangeNotifications() = 0;
    125123    virtual void stopDelayingAndCoalescingContentChangeNotifications() = 0;
  • trunk/Source/WebCore/page/Frame.h

    r163079 r163920  
    257257        NSRect caretRect() const;
    258258        NSRect rectForScrollToVisible() const;
    259         NSRect rectForSelection(VisibleSelection&) const;
    260259        DOMCSSStyleDeclaration* styleAtSelectionStart() const;
    261260        unsigned formElementsCharacterCount() const;
  • trunk/Source/WebCore/page/ios/FrameIOS.mm

    r163715 r163920  
    607607{
    608608    VisibleSelection selection(this->selection().selection());
    609     return rectForSelection(selection);
    610 }
    611 
    612 NSRect Frame::rectForSelection(VisibleSelection& selection) const
    613 {
     609
    614610    if (selection.isNone())
    615611        return CGRectZero;
     
    618614        return caretRect();
    619615
    620     EditorClient* client = editor().client();
    621     if (client)
    622         client->suppressSelectionNotifications();
    623 
    624     VisibleSelection originalSelection(selection);
    625     Position position;
    626 
    627     // The selection controllers below need to be associated with a frame in order
    628     // to calculate geometry. This causes them to do more work here than we would
    629     // like. Ideally, we would have a sort offline geometry-only mode for selection
    630     // controllers so we could do this kind of work as cheaply as possible.
    631 
    632     position = originalSelection.start();
    633     selection.setBase(position);
    634     selection.setExtent(position);
    635     FrameSelection startFrameSelection(const_cast<Frame*>(this));
    636     startFrameSelection.suppressCloseTyping();
    637     startFrameSelection.setSelection(selection);
    638     FloatRect startRect(startFrameSelection.absoluteCaretBounds());
    639     startFrameSelection.restoreCloseTyping();
    640 
    641     position = originalSelection.end();
    642     selection.setBase(position);
    643     selection.setExtent(position);
    644     FrameSelection endFrameSelection(const_cast<Frame*>(this));
    645     endFrameSelection.suppressCloseTyping();
    646     endFrameSelection.setSelection(selection);
    647     FloatRect endRect(endFrameSelection.absoluteCaretBounds());
    648     endFrameSelection.restoreCloseTyping();
    649 
    650     if (client)
    651         client->restoreSelectionNotifications();
    652 
    653     return unionRect(startRect, endRect);
     616    return unionRect(selection.visibleStart().absoluteCaretBounds(), selection.visibleEnd().absoluteCaretBounds());
    654617}
    655618
  • trunk/Source/WebKit/mac/ChangeLog

    r163916 r163920  
     12014-02-11  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Frame::rectForSelection shouldn't instantiate FrameSelection
     4        https://bugs.webkit.org/show_bug.cgi?id=128587
     5
     6        Reviewed by Enrica Casucci.
     7
     8        * WebCoreSupport/WebEditorClient.h:
     9        * WebCoreSupport/WebEditorClient.mm:
     10        (WebEditorClient::WebEditorClient):
     11        (WebEditorClient::respondToChangedSelection):
     12
    1132014-02-10  Myles C. Maxfield  <mmaxfield@apple.com>
    214
  • trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h

    r163715 r163920  
    135135
    136136#if PLATFORM(IOS)
    137     virtual void suppressSelectionNotifications() override;
    138     virtual void restoreSelectionNotifications() override;
    139137    virtual void startDelayingAndCoalescingContentChangeNotifications() override;
    140138    virtual void stopDelayingAndCoalescingContentChangeNotifications() override;
     
    173171    RefPtr<WebCore::TextCheckingRequest> m_textCheckingRequest;
    174172#if PLATFORM(IOS)
    175     int m_selectionNotificationSuppressions;
    176173    bool m_delayingContentChangeNotifications;
    177174    bool m_hasDelayedContentChangeNotification;
  • trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm

    r163715 r163920  
    195195    , m_haveUndoRedoOperations(false)
    196196#if PLATFORM(IOS)
    197     , m_selectionNotificationSuppressions(0)
    198197    , m_delayingContentChangeNotifications(0)
    199198    , m_hasDelayedContentChangeNotification(0)
     
    358357    // Selection can be changed while deallocating down the WebView / Frame / Editor.  Do not post in that case because it's already too late
    359358    // for the NSInvocation to retain the WebView.
    360     if (![m_webView _isClosing] && m_selectionNotificationSuppressions == 0)
     359    if (![m_webView _isClosing])
    361360        WebThreadPostNotification(WebViewDidChangeSelectionNotification, m_webView, nil);
    362361#endif
     
    798797
    799798#if PLATFORM(IOS)
    800 
    801 void WebEditorClient::suppressSelectionNotifications()
    802 {
    803     m_selectionNotificationSuppressions++;
    804 }
    805 
    806 void WebEditorClient::restoreSelectionNotifications()
    807 {
    808     --m_selectionNotificationSuppressions;
    809     if (m_selectionNotificationSuppressions < 0)
    810         m_selectionNotificationSuppressions = 0;
    811 }
    812799
    813800void WebEditorClient::writeDataToPasteboard(NSDictionary* representation)
  • trunk/Source/WebKit2/ChangeLog

    r163919 r163920  
     12014-02-11  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Frame::rectForSelection shouldn't instantiate FrameSelection
     4        https://bugs.webkit.org/show_bug.cgi?id=128587
     5
     6        Reviewed by Enrica Casucci.
     7
     8        * WebProcess/WebCoreSupport/WebEditorClient.h:
     9        * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
     10
    1112014-02-11  Enrica Casucci  <enrica@apple.com>
    212
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h

    r163712 r163920  
    154154#endif
    155155#if PLATFORM(IOS)
    156     virtual void suppressSelectionNotifications() override;
    157     virtual void restoreSelectionNotifications() override;
    158156    virtual void startDelayingAndCoalescingContentChangeNotifications() override;
    159157    virtual void stopDelayingAndCoalescingContentChangeNotifications() override;
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm

    r159724 r163920  
    7676}
    7777
    78 void WebEditorClient::suppressSelectionNotifications()
    79 {
    80     notImplemented();
    81 }
    82 
    83 void WebEditorClient::restoreSelectionNotifications()
    84 {
    85     notImplemented();
    86 }
    87 
    8878void WebEditorClient::startDelayingAndCoalescingContentChangeNotifications()
    8979{
Note: See TracChangeset for help on using the changeset viewer.