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

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

Issue 1814013002: Visual viewport API initial implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 9 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
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 r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 1223
1224 return body; 1224 return body;
1225 } 1225 }
1226 1226
1227 return documentElement(); 1227 return documentElement();
1228 } 1228 }
1229 1229
1230 return body(); 1230 return body();
1231 } 1231 }
1232 1232
1233 VisualViewport* Document::visualViewport()
1234 {
1235 if (FrameHost* host = frameHost())
1236 return &host->visualViewport();
1237 return nullptr;
1238 }
1239
1240 void Document::dispatchVisualViewportChangedEvent()
1241 {
1242 dispatchEvent(Event::create(EventTypeNames::visualviewportchanged));
1243 }
1244
1233 /* 1245 /*
1234 * Performs three operations: 1246 * Performs three operations:
1235 * 1. Convert control characters to spaces 1247 * 1. Convert control characters to spaces
1236 * 2. Trim leading and trailing spaces 1248 * 2. Trim leading and trailing spaces
1237 * 3. Collapse internal whitespace. 1249 * 3. Collapse internal whitespace.
1238 */ 1250 */
1239 template <typename CharacterType> 1251 template <typename CharacterType>
1240 static inline String canonicalizedTitle(Document* document, const String& title) 1252 static inline String canonicalizedTitle(Document* document, const String& title)
1241 { 1253 {
1242 unsigned length = title.length(); 1254 unsigned length = title.length();
(...skipping 4794 matching lines...) Expand 10 before | Expand all | Expand 10 after
6037 #ifndef NDEBUG 6049 #ifndef NDEBUG
6038 using namespace blink; 6050 using namespace blink;
6039 void showLiveDocumentInstances() 6051 void showLiveDocumentInstances()
6040 { 6052 {
6041 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 6053 Document::WeakDocumentSet& set = Document::liveDocumentSet();
6042 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6054 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6043 for (Document* document : set) 6055 for (Document* document : set)
6044 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6056 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6045 } 6057 }
6046 #endif 6058 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698