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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 23467007: Have Range constructor take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« Source/core/dom/Range.h ('K') | « Source/web/WebRange.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2264 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 return false; 2275 return false;
2276 FrameSelection& selection = frame->selection(); 2276 FrameSelection& selection = frame->selection();
2277 2277
2278 if (selection.isCaret()) { 2278 if (selection.isCaret()) {
2279 anchor = focus = selection.absoluteCaretBounds(); 2279 anchor = focus = selection.absoluteCaretBounds();
2280 } else { 2280 } else {
2281 RefPtr<Range> selectedRange = selection.toNormalizedRange(); 2281 RefPtr<Range> selectedRange = selection.toNormalizedRange();
2282 if (!selectedRange) 2282 if (!selectedRange)
2283 return false; 2283 return false;
2284 2284
2285 RefPtr<Range> range(Range::create(&selectedRange->startContainer()->docu ment(), 2285 RefPtr<Range> range(Range::create(selectedRange->startContainer()->docum ent(),
2286 selectedRange->startContainer(), 2286 selectedRange->startContainer(),
2287 selectedRange->startOffset(), 2287 selectedRange->startOffset(),
2288 selectedRange->startContainer(), 2288 selectedRange->startContainer(),
2289 selectedRange->startOffset())); 2289 selectedRange->startOffset()));
2290 anchor = frame->editor().firstRectForRange(range.get()); 2290 anchor = frame->editor().firstRectForRange(range.get());
2291 2291
2292 range = Range::create(&selectedRange->endContainer()->document(), 2292 range = Range::create(selectedRange->endContainer()->document(),
2293 selectedRange->endContainer(), 2293 selectedRange->endContainer(),
2294 selectedRange->endOffset(), 2294 selectedRange->endOffset(),
2295 selectedRange->endContainer(), 2295 selectedRange->endContainer(),
2296 selectedRange->endOffset()); 2296 selectedRange->endOffset());
2297 focus = frame->editor().firstRectForRange(range.get()); 2297 focus = frame->editor().firstRectForRange(range.get());
2298 } 2298 }
2299 2299
2300 IntRect scaledAnchor(frame->view()->contentsToWindow(anchor)); 2300 IntRect scaledAnchor(frame->view()->contentsToWindow(anchor));
2301 IntRect scaledFocus(frame->view()->contentsToWindow(focus)); 2301 IntRect scaledFocus(frame->view()->contentsToWindow(focus));
2302 scaledAnchor.scale(pageScaleFactor()); 2302 scaledAnchor.scale(pageScaleFactor());
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after
4105 } 4105 }
4106 4106
4107 bool WebViewImpl::shouldDisableDesktopWorkarounds() 4107 bool WebViewImpl::shouldDisableDesktopWorkarounds()
4108 { 4108 {
4109 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); 4109 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments();
4110 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom 4110 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom
4111 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); 4111 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto);
4112 } 4112 }
4113 4113
4114 } // namespace WebKit 4114 } // namespace WebKit
OLDNEW
« Source/core/dom/Range.h ('K') | « Source/web/WebRange.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698