Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(884)

Unified Diff: Source/web/PopupMenuImpl.cpp

Issue 1159833003: New SELECT Popup: Recalc style when a web font is loaded (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/StyleEngine.cpp ('k') | Tools/Scripts/webkitpy/layout_tests/servers/apache_http.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/PopupMenuImpl.cpp
diff --git a/Source/web/PopupMenuImpl.cpp b/Source/web/PopupMenuImpl.cpp
index 1304a6fa0fe9f6b5686f6340cfd0f111af32288f..55833ceacec0030b6b313ddbde2b517296b5989c 100644
--- a/Source/web/PopupMenuImpl.cpp
+++ b/Source/web/PopupMenuImpl.cpp
@@ -28,13 +28,15 @@
namespace blink {
-class PopupMenuCSSFontSelector : public CSSFontSelector {
+class PopupMenuCSSFontSelector : public CSSFontSelector, private CSSFontSelectorClient {
public:
static PassRefPtrWillBeRawPtr<PopupMenuCSSFontSelector> create(Document* document, CSSFontSelector* ownerFontSelector)
{
return adoptRefWillBeNoop(new PopupMenuCSSFontSelector(document, ownerFontSelector));
}
+ ~PopupMenuCSSFontSelector();
+
// We don't override willUseFontData() for now because the old PopupListBox
// only worked with fonts loaded when opening the popup.
virtual PassRefPtr<FontData> getFontData(const FontDescription&, const AtomicString&) override;
@@ -42,23 +44,42 @@ public:
DECLARE_VIRTUAL_TRACE();
private:
- PopupMenuCSSFontSelector(Document* document, CSSFontSelector* ownerFontSelector)
- : CSSFontSelector(document)
- , m_ownerFontSelector(ownerFontSelector)
- {
- }
+ PopupMenuCSSFontSelector(Document*, CSSFontSelector*);
+
+ virtual void fontsNeedUpdate(CSSFontSelector*) override;
+
RefPtrWillBeMember<CSSFontSelector> m_ownerFontSelector;
};
+PopupMenuCSSFontSelector::PopupMenuCSSFontSelector(Document* document, CSSFontSelector* ownerFontSelector)
+ : CSSFontSelector(document)
+ , m_ownerFontSelector(ownerFontSelector)
+{
+ m_ownerFontSelector->registerForInvalidationCallbacks(this);
+}
+
+PopupMenuCSSFontSelector::~PopupMenuCSSFontSelector()
+{
+#if !ENABLE(OILPAN)
+ m_ownerFontSelector->unregisterForInvalidationCallbacks(this);
+#endif
+}
+
PassRefPtr<FontData> PopupMenuCSSFontSelector::getFontData(const FontDescription& description, const AtomicString& name)
{
return m_ownerFontSelector->getFontData(description, name);
}
+void PopupMenuCSSFontSelector::fontsNeedUpdate(CSSFontSelector* fontSelector)
+{
+ dispatchInvalidationCallbacks();
+}
+
DEFINE_TRACE(PopupMenuCSSFontSelector)
{
visitor->trace(m_ownerFontSelector);
CSSFontSelector::trace(visitor);
+ CSSFontSelectorClient::trace(visitor);
}
PassRefPtrWillBeRawPtr<PopupMenuImpl> PopupMenuImpl::create(ChromeClientImpl* chromeClient, PopupMenuClient* client)
« no previous file with comments | « Source/core/dom/StyleEngine.cpp ('k') | Tools/Scripts/webkitpy/layout_tests/servers/apache_http.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698