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

Unified Diff: third_party/WebKit/Source/web/PopupMenuImpl.cpp

Issue 2606853002: SELECT popup: Don't use non-100% zoom level in popup. (Closed)
Patch Set: . Created 4 years 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
Index: third_party/WebKit/Source/web/PopupMenuImpl.cpp
diff --git a/third_party/WebKit/Source/web/PopupMenuImpl.cpp b/third_party/WebKit/Source/web/PopupMenuImpl.cpp
index a6a856dd14e8d49130c3fc66b4137a6353b86f16..c7c38399e713117e2c9dce0d954fe3e8f44f2a1d 100644
--- a/third_party/WebKit/Source/web/PopupMenuImpl.cpp
+++ b/third_party/WebKit/Source/web/PopupMenuImpl.cpp
@@ -177,7 +177,7 @@ class PopupMenuImpl::ItemIterationContext {
addProperty("textTransform",
String(textTransformToString(baseStyle().textTransform())),
m_buffer);
- addProperty("fontSize", baseFont().specifiedSize(), m_buffer);
+ addProperty("fontSize", baseFont().computedPixelSize(), m_buffer);
addProperty("fontStyle", String(fontStyleToString(baseFont().style())),
m_buffer);
addProperty("fontVariant",
@@ -292,14 +292,14 @@ void PopupMenuImpl::writeDocument(SharedBuffer* data) {
PagePopupClient::addString("],\n", data);
addProperty("anchorRectInScreen", anchorRectInScreen, data);
- float zoom = zoomFactor();
float scaleFactor = m_chromeClient->windowToViewportScalar(1.f);
- addProperty("zoomFactor", zoom / scaleFactor, data);
+ addProperty("zoomFactor", 1, data);
+ addProperty("scaleFactor", scaleFactor, data);
bool isRTL = !ownerStyle->isLeftToRightDirection();
addProperty("isRTL", isRTL, data);
addProperty("paddingStart",
- isRTL ? ownerElement.clientPaddingRight().toDouble() / zoom
- : ownerElement.clientPaddingLeft().toDouble() / zoom,
+ isRTL ? ownerElement.clientPaddingRight().toDouble()
+ : ownerElement.clientPaddingLeft().toDouble(),
data);
PagePopupClient::addString("};\n", data);
data->append(Platform::current()->loadResource("pickerCommon.js"));
@@ -340,8 +340,7 @@ void PopupMenuImpl::addElementStyle(ItemIterationContext& context,
if (baseFont.computedPixelSize() != fontDescription.computedPixelSize()) {
// We don't use FontDescription::specifiedSize() because this element
// might have its own zoom level.
- addProperty("fontSize", fontDescription.computedSize() / zoomFactor(),
- data);
+ addProperty("fontSize", fontDescription.computedPixelSize(), data);
}
// Our UA stylesheet has font-weight:normal for OPTION.
if (FontWeightNormal != fontDescription.weight())
« no previous file with comments | « third_party/WebKit/Source/web/PopupMenuImpl.h ('k') | third_party/WebKit/Source/web/resources/listPicker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698