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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2406163004: Simplify the usage of PositionWithAffinity (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/CaretBase.cpp » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 return HeapVector<Member<Element>>(); 1213 return HeapVector<Member<Element>>();
1214 return TreeScope::elementsFromPoint(x, y); 1214 return TreeScope::elementsFromPoint(x, y);
1215 } 1215 }
1216 1216
1217 Range* Document::caretRangeFromPoint(int x, int y) { 1217 Range* Document::caretRangeFromPoint(int x, int y) {
1218 if (layoutViewItem().isNull()) 1218 if (layoutViewItem().isNull())
1219 return nullptr; 1219 return nullptr;
1220 1220
1221 HitTestResult result = hitTestInDocument(this, x, y); 1221 HitTestResult result = hitTestInDocument(this, x, y);
1222 PositionWithAffinity positionWithAffinity = result.position(); 1222 PositionWithAffinity positionWithAffinity = result.position();
1223 if (positionWithAffinity.position().isNull()) 1223 if (positionWithAffinity.isNull())
1224 return nullptr; 1224 return nullptr;
1225 1225
1226 Position rangeCompliantPosition = 1226 Position rangeCompliantPosition =
1227 positionWithAffinity.position().parentAnchoredEquivalent(); 1227 positionWithAffinity.position().parentAnchoredEquivalent();
1228 return Range::createAdjustedToTreeScope(*this, rangeCompliantPosition); 1228 return Range::createAdjustedToTreeScope(*this, rangeCompliantPosition);
1229 } 1229 }
1230 1230
1231 Element* Document::scrollingElement() { 1231 Element* Document::scrollingElement() {
1232 if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) { 1232 if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) {
1233 if (inQuirksMode()) { 1233 if (inQuirksMode()) {
(...skipping 5167 matching lines...) Expand 10 before | Expand all | Expand 10 after
6401 } 6401 }
6402 6402
6403 void showLiveDocumentInstances() { 6403 void showLiveDocumentInstances() {
6404 WeakDocumentSet& set = liveDocumentSet(); 6404 WeakDocumentSet& set = liveDocumentSet();
6405 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6405 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6406 for (Document* document : set) 6406 for (Document* document : set)
6407 fprintf(stderr, "- Document %p URL: %s\n", document, 6407 fprintf(stderr, "- Document %p URL: %s\n", document,
6408 document->url().getString().utf8().data()); 6408 document->url().getString().utf8().data());
6409 } 6409 }
6410 #endif 6410 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/CaretBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698