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

Unified Diff: third_party/WebKit/Source/web/mac/WebSubstringUtil.mm

Issue 1656163002: Consider Zoom factor when getting bounding rect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 11 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 | « no previous file | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/mac/WebSubstringUtil.mm
diff --git a/third_party/WebKit/Source/web/mac/WebSubstringUtil.mm b/third_party/WebKit/Source/web/mac/WebSubstringUtil.mm
index d090fca882afb94326946c46855cfdb9d6cbefc7..2f92f6a4578a227884e0a716737863a7375a1a3d 100644
--- a/third_party/WebKit/Source/web/mac/WebSubstringUtil.mm
+++ b/third_party/WebKit/Source/web/mac/WebSubstringUtil.mm
@@ -83,8 +83,9 @@ static NSAttributedString* attributedSubstringFromRange(const EphemeralRange& ra
// using a web font. For now, just use the default font instead.
// TODO(rsesek): Change the font activation flags to allow other processes
// to use the font.
+ // TODO(shuchen): Support scaling the font as necessary according to CSS transforms.
if (!font)
- font = [NSFont systemFontOfSize:style->font().fontDescription().computedSize()];
+ font = [NSFont systemFontOfSize:style->font().fontDescription().computedSize()];
[attrs setObject:font forKey:NSFontAttributeName];
if (style->visitedDependentColor(CSSPropertyColor).alpha())
@@ -112,8 +113,9 @@ static NSAttributedString* attributedSubstringFromRange(const EphemeralRange& ra
WebPoint getBaselinePoint(FrameView* frameView, const EphemeralRange& range, NSAttributedString* string)
{
// Compute bottom left corner and convert to AppKit coordinates.
- // TODO(yosin) We shold avoid to create |Range| object. See crbug.com/529985.
- IntRect stringRect = enclosingIntRect(createRange(range)->boundingRect());
+ // TODO(yosin): We shold avoid to create |Range| object. See crbug.com/529985.
+ // TODO(shuchen): Support page-zoom for getting the baseline point.
+ IntRect stringRect = frameView->contentsToRootFrame(createRange(range)->boundingBox());
IntPoint stringPoint = stringRect.minXMaxYCorner();
stringPoint.setY(frameView->height() - stringPoint.y());
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698