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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2932593004: Update the snap points css properties (Closed)
Patch Set: Add CSS Attributes 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 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 overflow_y = EOverflow::kAuto; 1941 overflow_y = EOverflow::kAuto;
1942 if (overflow_anchor == EOverflowAnchor::kVisible) 1942 if (overflow_anchor == EOverflowAnchor::kVisible)
1943 overflow_anchor = EOverflowAnchor::kAuto; 1943 overflow_anchor = EOverflowAnchor::kAuto;
1944 // Column-gap is (ab)used by the current paged overflow implementation (in 1944 // Column-gap is (ab)used by the current paged overflow implementation (in
1945 // lack of other ways to specify gaps between pages), so we have to 1945 // lack of other ways to specify gaps between pages), so we have to
1946 // propagate it too. 1946 // propagate it too.
1947 column_gap = overflow_style->ColumnGap(); 1947 column_gap = overflow_style->ColumnGap();
1948 } 1948 }
1949 1949
1950 ScrollSnapType snap_type = overflow_style->GetScrollSnapType(); 1950 ScrollSnapType snap_type = overflow_style->GetScrollSnapType();
1951 const LengthPoint& snap_destination = overflow_style->ScrollSnapDestination();
1952 1951
1953 RefPtr<ComputedStyle> document_style = GetLayoutViewItem().MutableStyle(); 1952 RefPtr<ComputedStyle> document_style = GetLayoutViewItem().MutableStyle();
1954 if (document_style->GetWritingMode() != root_writing_mode || 1953 if (document_style->GetWritingMode() != root_writing_mode ||
1955 document_style->Direction() != root_direction || 1954 document_style->Direction() != root_direction ||
1956 document_style->VisitedDependentColor(CSSPropertyBackgroundColor) != 1955 document_style->VisitedDependentColor(CSSPropertyBackgroundColor) !=
1957 background_color || 1956 background_color ||
1958 document_style->BackgroundLayers() != background_layers || 1957 document_style->BackgroundLayers() != background_layers ||
1959 document_style->ImageRendering() != image_rendering || 1958 document_style->ImageRendering() != image_rendering ||
1960 document_style->OverflowAnchor() != overflow_anchor || 1959 document_style->OverflowAnchor() != overflow_anchor ||
1961 document_style->OverflowX() != overflow_x || 1960 document_style->OverflowX() != overflow_x ||
1962 document_style->OverflowY() != overflow_y || 1961 document_style->OverflowY() != overflow_y ||
1963 document_style->ColumnGap() != column_gap || 1962 document_style->ColumnGap() != column_gap ||
1964 document_style->GetScrollSnapType() != snap_type || 1963 document_style->GetScrollSnapType() != snap_type) {
1965 document_style->ScrollSnapDestination() != snap_destination) {
1966 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*document_style); 1964 RefPtr<ComputedStyle> new_style = ComputedStyle::Clone(*document_style);
1967 new_style->SetWritingMode(root_writing_mode); 1965 new_style->SetWritingMode(root_writing_mode);
1968 new_style->SetDirection(root_direction); 1966 new_style->SetDirection(root_direction);
1969 new_style->SetBackgroundColor(background_color); 1967 new_style->SetBackgroundColor(background_color);
1970 new_style->AccessBackgroundLayers() = background_layers; 1968 new_style->AccessBackgroundLayers() = background_layers;
1971 new_style->SetImageRendering(image_rendering); 1969 new_style->SetImageRendering(image_rendering);
1972 new_style->SetOverflowAnchor(overflow_anchor); 1970 new_style->SetOverflowAnchor(overflow_anchor);
1973 new_style->SetOverflowX(overflow_x); 1971 new_style->SetOverflowX(overflow_x);
1974 new_style->SetOverflowY(overflow_y); 1972 new_style->SetOverflowY(overflow_y);
1975 new_style->SetColumnGap(column_gap); 1973 new_style->SetColumnGap(column_gap);
1976 new_style->SetScrollSnapType(snap_type); 1974 new_style->SetScrollSnapType(snap_type);
1977 new_style->SetScrollSnapDestination(snap_destination);
1978 GetLayoutViewItem().SetStyle(new_style); 1975 GetLayoutViewItem().SetStyle(new_style);
1979 SetupFontBuilder(*new_style); 1976 SetupFontBuilder(*new_style);
1980 } 1977 }
1981 1978
1982 if (body) { 1979 if (body) {
1983 if (const ComputedStyle* style = body->GetComputedStyle()) { 1980 if (const ComputedStyle* style = body->GetComputedStyle()) {
1984 if (style->Direction() != root_direction || 1981 if (style->Direction() != root_direction ||
1985 style->GetWritingMode() != root_writing_mode) 1982 style->GetWritingMode() != root_writing_mode)
1986 body->SetNeedsStyleRecalc(kSubtreeStyleChange, 1983 body->SetNeedsStyleRecalc(kSubtreeStyleChange,
1987 StyleChangeReasonForTracing::Create( 1984 StyleChangeReasonForTracing::Create(
(...skipping 4886 matching lines...) Expand 10 before | Expand all | Expand 10 after
6874 } 6871 }
6875 6872
6876 void showLiveDocumentInstances() { 6873 void showLiveDocumentInstances() {
6877 WeakDocumentSet& set = liveDocumentSet(); 6874 WeakDocumentSet& set = liveDocumentSet();
6878 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6875 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6879 for (blink::Document* document : set) 6876 for (blink::Document* document : set)
6880 fprintf(stderr, "- Document %p URL: %s\n", document, 6877 fprintf(stderr, "- Document %p URL: %s\n", document,
6881 document->Url().GetString().Utf8().data()); 6878 document->Url().GetString().Utf8().data());
6882 } 6879 }
6883 #endif 6880 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698