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

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

Issue 1616813002: Consider Zoom factor when getting bounding rect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add TODOs. 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 350e9cb072ff92136e107450e6ab66a12decc15d..fb000452b5f4a654cd7454dd3e0a4f100850f979 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