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

Unified Diff: Source/core/dom/Document.cpp

Issue 715653004: Navigation transitions (web to native app): Hide/Show transition elements (Blink side) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add helper function Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 50bfccb701b158c6c80e287d9936e622c79077fb..5ef85b8c99b269694a820145e9b53603cb2d594f 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -5645,7 +5645,7 @@ void Document::getTransitionElementData(Vector<TransitionElementData>& elementDa
}
}
-void Document::hideTransitionElements(const AtomicString& cssSelector)
+void Document::updateElementOpacity(const AtomicString& cssSelector, double opacity)
{
TrackExceptionState exceptionState;
RefPtrWillBeRawPtr<StaticElementList> elementList = querySelectorAll(cssSelector, exceptionState);
@@ -5654,11 +5654,21 @@ void Document::hideTransitionElements(const AtomicString& cssSelector)
for (unsigned nodeIndex = 0; nodeIndex < nodeListLength; ++nodeIndex) {
Element* element = elementList->item(nodeIndex);
- element->setInlineStyleProperty(CSSPropertyOpacity, 0.0, CSSPrimitiveValue::CSS_NUMBER);
+ element->setInlineStyleProperty(CSSPropertyOpacity, opacity, CSSPrimitiveValue::CSS_NUMBER);
}
}
}
+void Document::hideTransitionElements(const AtomicString& cssSelector)
+{
+ updateElementOpacity(cssSelector, 0.0);
+}
+
+void Document::showTransitionElements(const AtomicString& cssSelector)
+{
+ updateElementOpacity(cssSelector, 1.0);
+}
+
bool Document::hasFocus() const
{
Page* page = this->page();

Powered by Google App Engine
This is Rietveld 408576698