⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 95244 in webkit


Ignore:
Timestamp:
Sep 15, 2011, 5:17:50 PM (15 years ago)
Author:
Beth Dakin
Message:

https://bugs.webkit.org/show_bug.cgi?id=67884
Delete button icon does not properly update when the device resolution changes
dynamically
-and corresponding-
<rdar://problem/10104632>

Reviewed by Darin Adler.

In DeleteButtonController::deviceScaleFactorChanged(), if the delete button is
currently showing, hide it and re-show it, forcing it to re-create the deletion
UI.

  • editing/DeleteButtonController.cpp:

(WebCore::DeleteButtonController::deviceScaleFactorChanged):

  • editing/DeleteButtonController.h:
  • editing/Editor.cpp:

(WebCore::Editor::deviceScaleFactorChanged):

  • editing/Editor.h:

Iterate through all of the frames and propagate the deviceScaleFactorChange()
message to Editor.

  • page/Page.cpp:

(WebCore::Page::setDeviceScaleFactor):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r95243 r95244  
     12011-09-15  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=67884
     4        Delete button icon does not properly update when the device resolution changes
     5        dynamically
     6        -and corresponding-
     7        <rdar://problem/10104632>
     8
     9        Reviewed by Darin Adler.
     10
     11        In DeleteButtonController::deviceScaleFactorChanged(), if the delete button is
     12        currently showing, hide it and re-show it, forcing it to re-create the deletion
     13        UI.
     14        * editing/DeleteButtonController.cpp:
     15        (WebCore::DeleteButtonController::deviceScaleFactorChanged):
     16        * editing/DeleteButtonController.h:
     17        * editing/Editor.cpp:
     18        (WebCore::Editor::deviceScaleFactorChanged):
     19        * editing/Editor.h:
     20
     21        Iterate through all of the frames and propagate the deviceScaleFactorChange()
     22        message to Editor.
     23        * page/Page.cpp:
     24        (WebCore::Page::setDeviceScaleFactor):
     25
    1262011-09-15  Chris Marrin  <cmarrin@apple.com>
    227
  • trunk/Source/WebCore/editing/DeleteButtonController.cpp

    r94900 r95244  
    186186}
    187187
     188void DeleteButtonController::deviceScaleFactorChanged()
     189{
     190    if (!enabled())
     191        return;
     192   
     193    HTMLElement* currentTarget = m_target.get();
     194    hide();
     195
     196    // Setting m_containerElement to 0 will force the deletionUI to be re-created with
     197    // artwork of the appropriate resolution in show().
     198    m_containerElement = 0;
     199    show(currentTarget);
     200}
     201
    188202void DeleteButtonController::createDeletionUI()
    189203{
  • trunk/Source/WebCore/editing/DeleteButtonController.h

    r76248 r95244  
    4949    void respondToChangedSelection(const VisibleSelection& oldSelection);
    5050
     51    void deviceScaleFactorChanged();
     52
    5153    void show(HTMLElement*);
    5254    void hide();
  • trunk/Source/WebCore/editing/Editor.cpp

    r94613 r95244  
    32323232}
    32333233
     3234void Editor::deviceScaleFactorChanged()
     3235{
     3236    m_deleteButtonController->deviceScaleFactorChanged();
     3237}
     3238
    32343239} // namespace WebCore
  • trunk/Source/WebCore/editing/Editor.h

    r94613 r95244  
    379379    void deletedAutocorrectionAtPosition(const Position&, const String& originalString);
    380380
     381    void deviceScaleFactorChanged();
     382
    381383private:
    382384    Frame* m_frame;
  • trunk/Source/WebCore/page/Page.cpp

    r94900 r95244  
    650650#endif
    651651
     652    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
     653        frame->editor()->deviceScaleFactorChanged();
     654
    652655    backForward()->markPagesForFullStyleRecalc();
    653656}
Note: See TracChangeset for help on using the changeset viewer.