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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 1424593002: Update layout tests to use internals.visualViewport APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo delete test that depends on "inert-visual-viewport" flag Created 5 years, 1 month 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 2440 matching lines...) Expand 10 before | Expand all | Expand 10 after
2451 String Internals::selectedTextForClipboard() 2451 String Internals::selectedTextForClipboard()
2452 { 2452 {
2453 return frame()->selection().selectedTextForClipboard(); 2453 return frame()->selection().selectedTextForClipboard();
2454 } 2454 }
2455 2455
2456 void Internals::setVisualViewportOffset(int x, int y) 2456 void Internals::setVisualViewportOffset(int x, int y)
2457 { 2457 {
2458 frame()->host()->visualViewport().setLocation(FloatPoint(x, y)); 2458 frame()->host()->visualViewport().setLocation(FloatPoint(x, y));
2459 } 2459 }
2460 2460
2461 int Internals::visualViewportHeight()
2462 {
2463 return expandedIntSize(frame()->host()->visualViewport().visibleRect().size( )).height();
2464 }
2465
2466 int Internals::visualViewportWidth()
2467 {
2468 return expandedIntSize(frame()->host()->visualViewport().visibleRect().size( )).width();
2469 }
2470
2471 double Internals::visualViewportScrollX()
2472 {
2473 return frame()->view()->scrollableArea()->scrollPositionDouble().x();
2474 }
2475
2476 double Internals::visualViewportScrollY()
2477 {
2478 return frame()->view()->scrollableArea()->scrollPositionDouble().y();
2479 }
2480
2461 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc eptionState&) 2481 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc eptionState&)
2462 { 2482 {
2463 return new InternalsIterationSource(); 2483 return new InternalsIterationSource();
2464 } 2484 }
2465 2485
2466 bool Internals::isUseCounted(Document* document, int useCounterId) 2486 bool Internals::isUseCounted(Document* document, int useCounterId)
2467 { 2487 {
2468 if (useCounterId < 0 || useCounterId >= UseCounter::NumberOfFeatures) 2488 if (useCounterId < 0 || useCounterId >= UseCounter::NumberOfFeatures)
2469 return false; 2489 return false;
2470 return UseCounter::isCounted(*document, static_cast<UseCounter::Feature>(use CounterId)); 2490 return UseCounter::isCounted(*document, static_cast<UseCounter::Feature>(use CounterId));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
2535 Document* document = contextDocument(); 2555 Document* document = contextDocument();
2536 if (!document) { 2556 if (!document) {
2537 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available."); 2557 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available.");
2538 return 0; 2558 return 0;
2539 } 2559 }
2540 2560
2541 return document->loader()->timing().monotonicTimeToZeroBasedDocumentTime(pla tformTime); 2561 return document->loader()->timing().monotonicTimeToZeroBasedDocumentTime(pla tformTime);
2542 } 2562 }
2543 2563
2544 } // namespace blink 2564 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.h ('k') | third_party/WebKit/Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698