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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.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 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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 1931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1942 overflow_y = EOverflow::kAuto; 1942 overflow_y = EOverflow::kAuto;
1943 if (overflow_anchor == EOverflowAnchor::kVisible) 1943 if (overflow_anchor == EOverflowAnchor::kVisible)
1944 overflow_anchor = EOverflowAnchor::kAuto; 1944 overflow_anchor = EOverflowAnchor::kAuto;
1945 // Column-gap is (ab)used by the current paged overflow implementation (in 1945 // Column-gap is (ab)used by the current paged overflow implementation (in
1946 // lack of other ways to specify gaps between pages), so we have to 1946 // lack of other ways to specify gaps between pages), so we have to
1947 // propagate it too. 1947 // propagate it too.
1948 column_gap = overflow_style->ColumnGap(); 1948 column_gap = overflow_style->ColumnGap();
1949 } 1949 }
1950 1950
1951 ScrollSnapType snap_type = overflow_style->GetScrollSnapType(); 1951 ScrollSnapType snap_type = overflow_style->GetScrollSnapType();
1952 const LengthPoint& snap_destination = overflow_style->ScrollSnapDestination();
1953 1952
1954 RefPtr<ComputedStyle> document_style = GetLayoutViewItem().MutableStyle(); 1953 RefPtr<ComputedStyle> document_style = GetLayoutViewItem().MutableStyle();
1955 if (document_style->GetWritingMode() != root_writing_mode || 1954 if (document_style->GetWritingMode() != root_writing_mode ||
1956 document_style->Direction() != root_direction || 1955 document_style->Direction() != root_direction ||
1957 document_style->VisitedDependentColor(CSSPropertyBackgroundColor) != 1956 document_style->VisitedDependentColor(CSSPropertyBackgroundColor) !=
1958 background_color || 1957 background_color ||
1959 document_style->BackgroundLayers() != background_layers || 1958 document_style->BackgroundLayers() != background_layers ||
1960 document_style->ImageRendering() != image_rendering || 1959 document_style->ImageRendering() != image_rendering ||
1961 document_style->OverflowAnchor() != overflow_anchor || 1960 document_style->OverflowAnchor() != overflow_anchor ||
1962 document_style->OverflowX() != overflow_x || 1961 document_style->OverflowX() != overflow_x ||
1963 document_style->OverflowY() != overflow_y || 1962 document_style->OverflowY() != overflow_y ||
1964 document_style->ColumnGap() != column_gap || 1963 document_style->ColumnGap() != column_gap ||
1965 document_style->GetScrollSnapType() != snap_type || 1964 document_style->GetScrollSnapType() != snap_type) {
1966 document_style->ScrollSnapDestination() != snap_destination) {
1967 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*document_style); 1965 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*document_style);
1968 new_style->SetWritingMode(root_writing_mode); 1966 new_style->SetWritingMode(root_writing_mode);
1969 new_style->SetDirection(root_direction); 1967 new_style->SetDirection(root_direction);
1970 new_style->SetBackgroundColor(background_color); 1968 new_style->SetBackgroundColor(background_color);
1971 new_style->AccessBackgroundLayers() = background_layers; 1969 new_style->AccessBackgroundLayers() = background_layers;
1972 new_style->SetImageRendering(image_rendering); 1970 new_style->SetImageRendering(image_rendering);
1973 new_style->SetOverflowAnchor(overflow_anchor); 1971 new_style->SetOverflowAnchor(overflow_anchor);
1974 new_style->SetOverflowX(overflow_x); 1972 new_style->SetOverflowX(overflow_x);
1975 new_style->SetOverflowY(overflow_y); 1973 new_style->SetOverflowY(overflow_y);
1976 new_style->SetColumnGap(column_gap); 1974 new_style->SetColumnGap(column_gap);
1977 new_style->SetScrollSnapType(snap_type); 1975 new_style->SetScrollSnapType(snap_type);
1978 new_style->SetScrollSnapDestination(snap_destination);
1979 GetLayoutViewItem().SetStyle(new_style); 1976 GetLayoutViewItem().SetStyle(new_style);
1980 SetupFontBuilder(*new_style); 1977 SetupFontBuilder(*new_style);
1981 } 1978 }
1982 1979
1983 if (body) { 1980 if (body) {
1984 if (const ComputedStyle* style = body->GetComputedStyle()) { 1981 if (const ComputedStyle* style = body->GetComputedStyle()) {
1985 if (style->Direction() != root_direction || 1982 if (style->Direction() != root_direction ||
1986 style->GetWritingMode() != root_writing_mode) 1983 style->GetWritingMode() != root_writing_mode)
1987 body->SetNeedsStyleRecalc(kSubtreeStyleChange, 1984 body->SetNeedsStyleRecalc(kSubtreeStyleChange,
1988 StyleChangeReasonForTracing::Create( 1985 StyleChangeReasonForTracing::Create(
(...skipping 4914 matching lines...) Expand 10 before | Expand all | Expand 10 after
6903 } 6900 }
6904 6901
6905 void showLiveDocumentInstances() { 6902 void showLiveDocumentInstances() {
6906 WeakDocumentSet& set = liveDocumentSet(); 6903 WeakDocumentSet& set = liveDocumentSet();
6907 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6904 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6908 for (blink::Document* document : set) 6905 for (blink::Document* document : set)
6909 fprintf(stderr, "- Document %p URL: %s\n", document, 6906 fprintf(stderr, "- Document %p URL: %s\n", document,
6910 document->Url().GetString().Utf8().data()); 6907 document->Url().GetString().Utf8().data());
6911 } 6908 }
6912 #endif 6909 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698