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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2932593004: Update the snap points css properties (Closed)
Patch Set: Fix nits Created 3 years, 6 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: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 8c1b379e40db31e9000cad793d53d6ef81948036..21f1a3197338dc6fb3d280da2ca6eb1d28d0088f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -451,20 +451,20 @@ void LayoutBox::UpdateScrollSnapMappingAfterStyleChange(
GetNode() != GetDocument().ViewportDefiningElement();
ScrollSnapType old_snap_type =
- old_style ? old_style->GetScrollSnapType() : kScrollSnapTypeNone;
+ old_style ? old_style->GetScrollSnapType() : ScrollSnapType();
ScrollSnapType new_snap_type = new_style && allows_snap_container
? new_style->GetScrollSnapType()
- : kScrollSnapTypeNone;
+ : ScrollSnapType();
if (old_snap_type != new_snap_type)
snap_coordinator->SnapContainerDidChange(*this, new_snap_type);
- Vector<LengthPoint> empty_vector;
- const Vector<LengthPoint>& old_snap_coordinate =
- old_style ? old_style->ScrollSnapCoordinate() : empty_vector;
- const Vector<LengthPoint>& new_snap_coordinate =
- new_style ? new_style->ScrollSnapCoordinate() : empty_vector;
- if (old_snap_coordinate != new_snap_coordinate)
- snap_coordinator->SnapAreaDidChange(*this, new_snap_coordinate);
+ ScrollSnapAlign old_snap_align =
+ old_style ? old_style->GetScrollSnapAlign() : ScrollSnapAlign();
+ ScrollSnapAlign new_snap_align = new_style && allows_snap_container
+ ? new_style->GetScrollSnapAlign()
+ : ScrollSnapAlign();
+ if (old_snap_align != new_snap_align)
+ snap_coordinator->SnapAreaDidChange(*this, new_snap_align);
}
void LayoutBox::AddScrollSnapMapping() {

Powered by Google App Engine
This is Rietveld 408576698