Title: [95244] trunk/Source/WebCore
- Revision
- 95244
- Author
- bda...@apple.com
- Date
- 2011-09-15 17:17:50 -0700 (Thu, 15 Sep 2011)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (95243 => 95244)
--- trunk/Source/WebCore/ChangeLog 2011-09-15 23:50:56 UTC (rev 95243)
+++ trunk/Source/WebCore/ChangeLog 2011-09-16 00:17:50 UTC (rev 95244)
@@ -1,3 +1,28 @@
+2011-09-15 Beth Dakin <bda...@apple.com>
+
+ 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):
+
2011-09-15 Chris Marrin <cmar...@apple.com>
Crash can occur when doing a PlatformCAAnimation::copy() with no valueFunction
Modified: trunk/Source/WebCore/editing/DeleteButtonController.cpp (95243 => 95244)
--- trunk/Source/WebCore/editing/DeleteButtonController.cpp 2011-09-15 23:50:56 UTC (rev 95243)
+++ trunk/Source/WebCore/editing/DeleteButtonController.cpp 2011-09-16 00:17:50 UTC (rev 95244)
@@ -185,6 +185,20 @@
hide();
}
+void DeleteButtonController::deviceScaleFactorChanged()
+{
+ if (!enabled())
+ return;
+
+ HTMLElement* currentTarget = m_target.get();
+ hide();
+
+ // Setting m_containerElement to 0 will force the deletionUI to be re-created with
+ // artwork of the appropriate resolution in show().
+ m_containerElement = 0;
+ show(currentTarget);
+}
+
void DeleteButtonController::createDeletionUI()
{
RefPtr<HTMLDivElement> container = HTMLDivElement::create(m_target->document());
Modified: trunk/Source/WebCore/editing/DeleteButtonController.h (95243 => 95244)
--- trunk/Source/WebCore/editing/DeleteButtonController.h 2011-09-15 23:50:56 UTC (rev 95243)
+++ trunk/Source/WebCore/editing/DeleteButtonController.h 2011-09-16 00:17:50 UTC (rev 95244)
@@ -48,6 +48,8 @@
void respondToChangedSelection(const VisibleSelection& oldSelection);
+ void deviceScaleFactorChanged();
+
void show(HTMLElement*);
void hide();
Modified: trunk/Source/WebCore/editing/Editor.cpp (95243 => 95244)
--- trunk/Source/WebCore/editing/Editor.cpp 2011-09-15 23:50:56 UTC (rev 95243)
+++ trunk/Source/WebCore/editing/Editor.cpp 2011-09-16 00:17:50 UTC (rev 95244)
@@ -3231,4 +3231,9 @@
return checkingTypes;
}
+void Editor::deviceScaleFactorChanged()
+{
+ m_deleteButtonController->deviceScaleFactorChanged();
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/editing/Editor.h (95243 => 95244)
--- trunk/Source/WebCore/editing/Editor.h 2011-09-15 23:50:56 UTC (rev 95243)
+++ trunk/Source/WebCore/editing/Editor.h 2011-09-16 00:17:50 UTC (rev 95244)
@@ -378,6 +378,8 @@
void updateMarkersForWordsAffectedByEditing(bool onlyHandleWordsContainingSelection);
void deletedAutocorrectionAtPosition(const Position&, const String& originalString);
+ void deviceScaleFactorChanged();
+
private:
Frame* m_frame;
OwnPtr<DeleteButtonController> m_deleteButtonController;
Modified: trunk/Source/WebCore/page/Page.cpp (95243 => 95244)
--- trunk/Source/WebCore/page/Page.cpp 2011-09-15 23:50:56 UTC (rev 95243)
+++ trunk/Source/WebCore/page/Page.cpp 2011-09-16 00:17:50 UTC (rev 95244)
@@ -649,6 +649,9 @@
m_mainFrame->deviceOrPageScaleFactorChanged();
#endif
+ for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+ frame->editor()->deviceScaleFactorChanged();
+
backForward()->markPagesForFullStyleRecalc();
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes