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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2386033002: Scale focus outline thickness with zoom level. (Closed)
Patch Set: merge conflicts Created 4 years, 2 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
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 2fc9f7e27dc9240c7390ee3a11a628a2d71227d6..9ffaa836a47b1a38607cece2204463f3e1d5c9bb 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -2184,12 +2184,23 @@ void ComputedStyle::setOffsetPath(PassRefPtr<StylePath> path) {
int ComputedStyle::outlineOutsetExtent() const {
if (!hasOutline())
return 0;
- if (outlineStyleIsAuto())
- return GraphicsContext::focusRingOutsetExtent(outlineOffset(),
- outlineWidth());
+ if (outlineStyleIsAuto()) {
+ return GraphicsContext::focusRingOutsetExtent(
+ outlineOffset(), getOutlineStrokeWidthForFocusRing());
+ }
return std::max(0, saturatedAddition(outlineWidth(), outlineOffset()));
}
+float ComputedStyle::getOutlineStrokeWidthForFocusRing() const {
+#if OS(MACOSX)
+ return outlineWidth();
+#else
+ // Draw an outline with thickness in proportion to the zoom level, but never
+ // less than 1 pixel so that it remains visible.
+ return std::max(effectiveZoom(), 1.f);
+#endif
+}
+
bool ComputedStyle::columnRuleEquivalent(
const ComputedStyle* otherStyle) const {
return columnRuleStyle() == otherStyle->columnRuleStyle() &&
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698