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

Unified Diff: LayoutTests/fast/html/navigation-transition.html

Issue 476553002: Navigation transitions: Hide transition elements by setting CSS opacity rather than display. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
Index: LayoutTests/fast/html/navigation-transition.html
diff --git a/LayoutTests/fast/html/navigation-transition.html b/LayoutTests/fast/html/navigation-transition.html
index 1220df12e44cb3023bfc459edce70d1d574c4e6c..1dfea03b9c4411b91adb032119faa331fe523589 100644
--- a/LayoutTests/fast/html/navigation-transition.html
+++ b/LayoutTests/fast/html/navigation-transition.html
@@ -9,19 +9,38 @@ jsTestIsAsync = true;
window.onload = function() {
if (window.internals) {
- var serializedHTML = internals.serializeNavigationMarkup(document);
+ var serializedHTML = internals.serializeNavigationMarkup();
var testiframe = document.getElementById('testiframe');
testiframe.contentDocument.write(serializedHTML);
+ transitionElement = document.getElementById('transitionElement');
sourceElement = document.getElementById('boxTransitionElement');
destElement = testiframe.contentDocument.getElementById('boxTransitionElement');
sourceElementRect = sourceElement.getBoundingClientRect();
+
+ bottomElement = document.getElementById('bottomElement');
+
+ preHidingBottomElementRect = bottomElement.getBoundingClientRect();
+ preHidingTransitionElementVisibility = window.getComputedStyle(transitionElement).visibility;
+
+ internals.hideAllTransitionElements();
+
+ postHidingTransitionElementVisibility = window.getComputedStyle(transitionElement).visibility;
+ postHidingBottomElementRect = bottomElement.getBoundingClientRect();
+
shouldBe('sourceElementRect.top', 'destElement.offsetTop');
shouldBe('sourceElementRect.left', 'destElement.offsetLeft');
shouldBe('sourceElementRect.height', 'destElement.offsetHeight');
shouldBe('sourceElementRect.width', 'destElement.offsetWidth');
+ shouldBeTrue('preHidingTransitionElementVisibility == "visible"');
+ shouldBeTrue('postHidingTransitionElementVisibility == "hidden"');
+
+ // Hiding transition elements should not shift any other elements on the page.
+ shouldBe('preHidingBottomElementRect.top', 'postHidingBottomElementRect.top');
+ shouldBe('preHidingBottomElementRect.left', 'postHidingBottomElementRect.left');
+
finishJSTest();
}
}
@@ -70,11 +89,13 @@ body {
</style>
<div id="wrappingElement">
- <div id="transitionElement">This text should appear twice.</div>
+ <div id="transitionElement">Header</div>
<div id="boxTransitionElement">
<img id="blueBox" src="resources/images/blue.png">
</div>
+
+ <div id="bottomElement">Footer</div>
</div>
<iframe id="testiframe"></iframe>
« no previous file with comments | « no previous file | LayoutTests/fast/html/navigation-transition-expected.txt » ('j') | Source/core/dom/Document.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698