Changeset 181189 in webkit
- Timestamp:
- Mar 6, 2015 3:39:57 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181183 r181189 1 2015-03-06 Brent Fulgham <bfulgham@apple.com> 2 3 Add 'initial' keyword support for scroll snap CSS properties 4 https://bugs.webkit.org/show_bug.cgi?id=136345 5 <rdar://problem/18162325> 6 7 Reviewed by Dean Jackson. 8 9 * css3/scroll-snap/scroll-snap-property-computed-style.js: Update for corrected 'initial' behavior. 10 * css3/scroll-snap/scroll-snap-property-computed-style-expected.txt: Rebaselined. 11 * css3/scroll-snap/scroll-snap-initial.html: Added. 12 * css3/scroll-snap/scroll-snap-initial-expected.txt: Added. 13 * platform/efl/TestExpectations: 14 * platform/gtk/TestExpectations: 15 * platform/win/TestExpectations: 16 1 17 2015-03-06 Joseph Pecoraro <pecoraro@apple.com> 2 18 -
trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style-expected.txt
r173659 r181189 9 9 10 10 invalid points along x axis : hello world 11 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is ' repeat(100%)'11 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'none' 12 12 13 13 invalid points along y axis : hello world 14 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is ' repeat(100%)'14 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is 'none' 15 15 16 16 typo in point definition : repaet(50px) 17 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is ' repeat(100%)'17 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'none' 18 18 19 19 another invalid point definition : ??px repeat(50px) 20 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is ' repeat(100%)'20 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'none' 21 21 22 22 invalid destination : foo bar … … 51 51 52 52 inherited points along x axis : inherit 53 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is ' repeat(100%)'53 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'none' 54 54 55 55 initial points along x axis : initial 56 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is ' repeat(100%)'56 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'none' 57 57 58 58 element points along x axis : elements … … 84 84 85 85 inherited points along y axis : inherit 86 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is ' repeat(100%)'86 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is 'none' 87 87 88 88 initial points along y axis : initial 89 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is ' repeat(100%)'89 PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is 'none' 90 90 91 91 element points along y axis : elements -
trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style.js
r173659 r181189 18 18 19 19 testComputedScrollSnapRule("invalid snapping type", "type", "potato", "none"); 20 testComputedScrollSnapRule("invalid points along x axis", "points-x", "hello world", " repeat(100%)");21 testComputedScrollSnapRule("invalid points along y axis", "points-y", "hello world", " repeat(100%)");22 testComputedScrollSnapRule("typo in point definition", "points-x", "repaet(50px)", " repeat(100%)");23 testComputedScrollSnapRule("another invalid point definition", "points-x", "??px repeat(50px)", " repeat(100%)");20 testComputedScrollSnapRule("invalid points along x axis", "points-x", "hello world", "none"); 21 testComputedScrollSnapRule("invalid points along y axis", "points-y", "hello world", "none"); 22 testComputedScrollSnapRule("typo in point definition", "points-x", "repaet(50px)", "none"); 23 testComputedScrollSnapRule("another invalid point definition", "points-x", "??px repeat(50px)", "none"); 24 24 testComputedScrollSnapRule("invalid destination", "destination", "foo bar", "0px 0px"); 25 25 testComputedScrollSnapRule("short one destination value", "destination", "50%", "0px 0px"); … … 34 34 testComputedScrollSnapRule("proximity type", "type", "proximity", "proximity"); 35 35 36 testComputedScrollSnapRule("inherited points along x axis", "points-x", "inherit", " repeat(100%)");37 testComputedScrollSnapRule("initial points along x axis", "points-x", "initial", " repeat(100%)");36 testComputedScrollSnapRule("inherited points along x axis", "points-x", "inherit", "none"); 37 testComputedScrollSnapRule("initial points along x axis", "points-x", "initial", "none"); 38 38 testComputedScrollSnapRule("element points along x axis", "points-x", "elements", "elements"); 39 39 testComputedScrollSnapRule("percentage points along x axis", "points-x", "100% 50%", "100% 50%"); … … 46 46 testComputedScrollSnapRule("pixel points along x axis with pixel repeat", "points-x", "100px repeat(42px)", "100px repeat(42px)"); 47 47 48 testComputedScrollSnapRule("inherited points along y axis", "points-y", "inherit", " repeat(100%)");49 testComputedScrollSnapRule("initial points along y axis", "points-y", "initial", " repeat(100%)");48 testComputedScrollSnapRule("inherited points along y axis", "points-y", "inherit", "none"); 49 testComputedScrollSnapRule("initial points along y axis", "points-y", "initial", "none"); 50 50 testComputedScrollSnapRule("element points along y axis", "points-y", "elements", "elements"); 51 51 testComputedScrollSnapRule("percentage points along y axis", "points-y", "100% 50%", "100% 50%"); -
trunk/LayoutTests/platform/efl/TestExpectations
r181148 r181189 59 59 fast/dom/Window/slow-unload-handler.html 60 60 fast/dom/Window/slow-unload-handler-only-frame-is-stopped.html 61 62 # Need a scroll snap point implementation 63 css3/scroll-snap [ Skip ] 61 64 62 65 # ---------------------------------------- -
trunk/LayoutTests/platform/gtk/TestExpectations
r181012 r181189 621 621 webkit.org/b/142291 fast/regions/repaint/fixed-in-named-flow-cb-changed.html [ ImageOnlyFailure ] 622 622 623 623 # TODO Scroll snap points 624 css3/scroll-snap [ Skip ] 624 625 #//////////////////////////////////////////////////////////////////////////////////////// 625 626 # End of Expected failures -
trunk/LayoutTests/platform/win/TestExpectations
r181135 r181189 592 592 # TODO Attachment elements do not provide a custom renderer 593 593 webkit.org/b/142260 fast/attachment [ Skip ] 594 595 # TODO Scroll snap points 596 css3/scroll-snap [ Skip ] 594 597 ################################################################################ 595 598 ########### End Missing Functionality Prevents Testing ############## -
trunk/Source/WebCore/ChangeLog
r181178 r181189 1 2015-03-06 Brent Fulgham <bfulgham@apple.com> 2 3 Add 'initial' keyword support for scroll snap CSS properties 4 https://bugs.webkit.org/show_bug.cgi?id=136345 5 <rdar://problem/18162325> 6 7 Reviewed by Dean Jackson. 8 9 Tested by css3/scroll-snap/scroll-snap-initial.html 10 11 The existing implementation already had 'initial' keyword support, but did not fully follow 12 the CSS specification. In particular, the 'initial' state for the scroll-snap-points-x and 13 scroll-snap-points-y properties was not handled correctly. 14 15 Revise implementation to represent ScrollSnapPoints as a pointer, so that 'none' is a valid 16 state. 17 18 * css/CSSComputedStyleDeclaration.cpp: 19 (WebCore::scrollSnapPoints): If 'points' is null, return CSSValueNone. 20 * css/CSSPropertyNames.in: Provide custom initial/inherit handles for snap point x/y sets. 21 * css/StyleBuilderConverter.h: 22 (WebCore::StyleBuilderConverter::convertScrollSnapPoints): Update to represent ScrollSnapPoints 23 as a pointer. 24 * css/StyleBuilderCustom.h: 25 (WebCore::StyleBuilderCustom::applyInitialWebkitScrollSnapPointsX): Provide custom pointer-based 26 implementation for ScrollSnapPoints. 27 (WebCore::StyleBuilderCustom::applyInheritWebkitScrollSnapPointsX): Ditto. 28 (WebCore::StyleBuilderCustom::applyInitialWebkitScrollSnapPointsY): Ditto. 29 (WebCore::StyleBuilderCustom::applyInheritWebkitScrollSnapPointsY): Ditto." 30 * page/scrolling/AxisScrollSnapOffsets.cpp: 31 (WebCore::updateFromStyle): Handle ScrollSnapPoints as pointers. 32 (WebCore::updateSnapOffsetsForScrollableArea): Ditto. 33 * rendering/style/RenderStyle.cpp: 34 (WebCore::RenderStyle::scrollSnapPointsX): Update to use pointer-based representation of ScrollSnapPoints. 35 (WebCore::RenderStyle::scrollSnapPointsY): Ditto. 36 (WebCore::RenderStyle::setScrollSnapPointsX): Ditto. 37 (WebCore::RenderStyle::setScrollSnapPointsY): Ditto. 38 (WebCore::RenderStyle::initialScrollSnapPointsX): Deleted. 39 (WebCore::RenderStyle::initialScrollSnapPointsY): Deleted. 40 * rendering/style/RenderStyle.h: 41 * rendering/style/StyleScrollSnapPoints.cpp: 42 (WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints): Revise constructor to handle pointer argument. 43 * rendering/style/StyleScrollSnapPoints.h: 44 1 45 2015-03-05 Roger Fong <roger_fong@apple.com> 2 46 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r180689 r181189 1107 1107 1108 1108 #if ENABLE(CSS_SCROLL_SNAP) 1109 1110 1109 static Ref<CSSValueList> scrollSnapDestination(RenderStyle& style, const LengthSize& destination) 1111 1110 { … … 1116 1115 } 1117 1116 1118 static Ref<CSSValue> scrollSnapPoints(RenderStyle& style, const ScrollSnapPoints& points) 1119 { 1120 if (points.usesElements) 1117 static Ref<CSSValue> scrollSnapPoints(RenderStyle& style, const ScrollSnapPoints* points) 1118 { 1119 if (!points) 1120 return cssValuePool().createIdentifierValue(CSSValueNone); 1121 1122 if (points->usesElements) 1121 1123 return cssValuePool().createIdentifierValue(CSSValueElements); 1122 1124 auto list = CSSValueList::createSpaceSeparated(); 1123 for (auto& point : points .offsets)1125 for (auto& point : points->offsets) 1124 1126 list.get().append(percentageOrZoomAdjustedValue(point, &style)); 1125 if (points .hasRepeat)1126 list.get().append(cssValuePool().createValue(LengthRepeat::create(percentageOrZoomAdjustedValue(points .repeatOffset, &style))));1127 if (points->hasRepeat) 1128 list.get().append(cssValuePool().createValue(LengthRepeat::create(percentageOrZoomAdjustedValue(points->repeatOffset, &style)))); 1127 1129 return WTF::move(list); 1128 1130 } … … 1144 1146 return WTF::move(list); 1145 1147 } 1146 1147 1148 #endif 1148 1149 -
trunk/Source/WebCore/css/CSSPropertyNames.in
r180689 r181189 561 561 -webkit-rtl-ordering [Inherited, Setter=setRTLOrdering, Initial=initialRTLOrdering] 562 562 #if defined(ENABLE_CSS_SCROLL_SNAP) 563 -webkit-scroll-snap-points-x [Converter=ScrollSnapPoints ]564 -webkit-scroll-snap-points-y [Converter=ScrollSnapPoints ]563 -webkit-scroll-snap-points-x [Converter=ScrollSnapPoints, Custom=Initial|Inherit] 564 -webkit-scroll-snap-points-y [Converter=ScrollSnapPoints, Custom=Initial|Inherit] 565 565 -webkit-scroll-snap-type 566 566 -webkit-scroll-snap-destination [Converter=SnapCoordinatePair] -
trunk/Source/WebCore/css/StyleBuilderConverter.h
r180140 r181189 91 91 static PassRefPtr<ShapeValue> convertShapeValue(StyleResolver&, CSSValue&); 92 92 #if ENABLE(CSS_SCROLL_SNAP) 93 static ScrollSnapPointsconvertScrollSnapPoints(StyleResolver&, CSSValue&);93 static std::unique_ptr<ScrollSnapPoints> convertScrollSnapPoints(StyleResolver&, CSSValue&); 94 94 static LengthSize convertSnapCoordinatePair(StyleResolver&, CSSValue&, size_t offset = 0); 95 95 static Vector<LengthSize> convertScrollSnapCoordinates(StyleResolver&, CSSValue&); … … 709 709 } 710 710 711 inline ScrollSnapPointsStyleBuilderConverter::convertScrollSnapPoints(StyleResolver& styleResolver, CSSValue& value)712 { 713 ScrollSnapPoints points;711 inline std::unique_ptr<ScrollSnapPoints> StyleBuilderConverter::convertScrollSnapPoints(StyleResolver& styleResolver, CSSValue& value) 712 { 713 auto points = std::make_unique<ScrollSnapPoints>(); 714 714 715 715 if (is<CSSPrimitiveValue>(value)) { 716 716 ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueElements); 717 points .usesElements = true;717 points->usesElements = true; 718 718 return points; 719 719 } 720 720 721 points .hasRepeat = false;721 points->hasRepeat = false; 722 722 for (auto& currentValue : downcast<CSSValueList>(value)) { 723 723 auto& itemValue = downcast<CSSPrimitiveValue>(currentValue.get()); 724 724 if (auto* lengthRepeat = itemValue.getLengthRepeatValue()) { 725 725 if (auto* interval = lengthRepeat->interval()) { 726 points .repeatOffset = parseSnapCoordinate(styleResolver, *interval);727 points .hasRepeat = true;726 points->repeatOffset = parseSnapCoordinate(styleResolver, *interval); 727 points->hasRepeat = true; 728 728 break; 729 729 } 730 730 } 731 points .offsets.append(parseSnapCoordinate(styleResolver, itemValue));731 points->offsets.append(parseSnapCoordinate(styleResolver, itemValue)); 732 732 } 733 733 -
trunk/Source/WebCore/css/StyleBuilderCustom.h
r179100 r181189 129 129 static void applyValueWebkitWritingMode(StyleResolver&, CSSValue&); 130 130 static void applyValueAlt(StyleResolver&, CSSValue&); 131 #if ENABLE(CSS_SCROLL_SNAP) 132 static void applyInitialWebkitScrollSnapPointsX(StyleResolver&); 133 static void applyInheritWebkitScrollSnapPointsX(StyleResolver&); 134 static void applyInitialWebkitScrollSnapPointsY(StyleResolver&); 135 static void applyInheritWebkitScrollSnapPointsY(StyleResolver&); 136 #endif 131 137 132 138 private: … … 1694 1700 } 1695 1701 1702 #if ENABLE(CSS_SCROLL_SNAP) 1703 inline void StyleBuilderCustom::applyInitialWebkitScrollSnapPointsX(StyleResolver& styleResolver) 1704 { 1705 styleResolver.style()->setScrollSnapPointsX(nullptr); 1706 } 1707 1708 inline void StyleBuilderCustom::applyInheritWebkitScrollSnapPointsX(StyleResolver& styleResolver) 1709 { 1710 styleResolver.style()->setScrollSnapPointsX(styleResolver.parentStyle()->scrollSnapPointsX() ? std::make_unique<ScrollSnapPoints>(*styleResolver.parentStyle()->scrollSnapPointsX()) : nullptr); 1711 } 1712 1713 inline void StyleBuilderCustom::applyInitialWebkitScrollSnapPointsY(StyleResolver& styleResolver) 1714 { 1715 styleResolver.style()->setScrollSnapPointsY(nullptr); 1716 } 1717 1718 inline void StyleBuilderCustom::applyInheritWebkitScrollSnapPointsY(StyleResolver& styleResolver) 1719 { 1720 styleResolver.style()->setScrollSnapPointsY(styleResolver.parentStyle()->scrollSnapPointsY() ? std::make_unique<ScrollSnapPoints>(*styleResolver.parentStyle()->scrollSnapPointsY()) : nullptr); 1721 } 1722 #endif 1723 1696 1724 } // namespace WebCore 1697 1725 -
trunk/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp
r175947 r181189 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014-2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 76 76 77 77 bool isHorizontalAxis = axis == ScrollEventAxis::Horizontal; 78 auto &points = isHorizontalAxis ? style.scrollSnapPointsX() : style.scrollSnapPointsY();78 auto* points = isHorizontalAxis ? style.scrollSnapPointsX() : style.scrollSnapPointsY(); 79 79 auto& destination = style.scrollSnapDestination(); 80 bool hasRepeat = points .hasRepeat;81 LayoutUnit repeatOffset = valueForLength(points.repeatOffset, viewSize);80 bool hasRepeat = points ? points->hasRepeat : false; 81 LayoutUnit repeatOffset = points ? valueForLength(points->repeatOffset, viewSize) : LayoutUnit(); 82 82 LayoutUnit destinationOffset = valueForLength(isHorizontalAxis ? destination.width() : destination.height(), viewSize); 83 83 LayoutUnit curSnapPositionShift = 0; … … 131 131 Vector<LayoutUnit> verticalSnapOffsetSubsequence; 132 132 133 if (scrollingElementStyle.scrollSnapPointsX().usesElements || scrollingElementStyle.scrollSnapPointsY().usesElements) { 134 bool shouldAddHorizontalChildOffsets = scrollingElementStyle.scrollSnapPointsX().usesElements && canComputeHorizontalOffsets; 135 bool shouldAddVerticalChildOffsets = scrollingElementStyle.scrollSnapPointsY().usesElements && canComputeVerticalOffsets; 133 bool scrollSnapPointsXUsesElements = scrollingElementStyle.scrollSnapPointsX() ? scrollingElementStyle.scrollSnapPointsX()->usesElements : false; 134 bool scrollSnapPointsYUsesElements = scrollingElementStyle.scrollSnapPointsY() ? scrollingElementStyle.scrollSnapPointsY()->usesElements : false; 135 136 if (scrollSnapPointsXUsesElements || scrollSnapPointsYUsesElements) { 137 bool shouldAddHorizontalChildOffsets = scrollSnapPointsXUsesElements && canComputeHorizontalOffsets; 138 bool shouldAddVerticalChildOffsets = scrollSnapPointsYUsesElements && canComputeVerticalOffsets; 136 139 appendChildSnapOffsets(scrollingElement, shouldAddHorizontalChildOffsets, horizontalSnapOffsetSubsequence, shouldAddVerticalChildOffsets, verticalSnapOffsetSubsequence); 137 140 } 138 141 139 if ( !scrollingElementStyle.scrollSnapPointsX().usesElements && canComputeHorizontalOffsets) {140 for (auto& snapLength : scrollingElementStyle.scrollSnapPointsX() .offsets)142 if (scrollingElementStyle.scrollSnapPointsX() && !scrollSnapPointsXUsesElements && canComputeHorizontalOffsets) { 143 for (auto& snapLength : scrollingElementStyle.scrollSnapPointsX()->offsets) 141 144 horizontalSnapOffsetSubsequence.append(valueForLength(snapLength, viewWidth)); 142 145 } 143 146 144 if ( !scrollingElementStyle.scrollSnapPointsY().usesElements && canComputeVerticalOffsets) {145 for (auto& snapLength : scrollingElementStyle.scrollSnapPointsY() .offsets)147 if (scrollingElementStyle.scrollSnapPointsY() && !scrollSnapPointsYUsesElements && canComputeVerticalOffsets) { 148 for (auto& snapLength : scrollingElementStyle.scrollSnapPointsY()->offsets) 146 149 verticalSnapOffsetSubsequence.append(valueForLength(snapLength, viewHeight)); 147 150 } -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r181164 r181189 1 1 /* 2 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * Copyright (C) 2004-201 4Apple Inc. All rights reserved.3 * Copyright (C) 2004-2015 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 5 * … … 1866 1866 1867 1867 #if ENABLE(CSS_SCROLL_SNAP) 1868 1869 ScrollSnapPoints RenderStyle::initialScrollSnapPointsX()1870 {1871 return ScrollSnapPoints();1872 }1873 1874 ScrollSnapPoints RenderStyle::initialScrollSnapPointsY()1875 {1876 return ScrollSnapPoints();1877 }1878 1879 1868 LengthSize RenderStyle::initialScrollSnapDestination() 1880 1869 { … … 1887 1876 } 1888 1877 1889 const ScrollSnapPoints &RenderStyle::scrollSnapPointsX() const1890 { 1891 return rareNonInheritedData->m_scrollSnapPoints->xPoints ;1892 } 1893 1894 const ScrollSnapPoints &RenderStyle::scrollSnapPointsY() const1895 { 1896 return rareNonInheritedData->m_scrollSnapPoints->yPoints ;1878 const ScrollSnapPoints* RenderStyle::scrollSnapPointsX() const 1879 { 1880 return rareNonInheritedData->m_scrollSnapPoints->xPoints.get(); 1881 } 1882 1883 const ScrollSnapPoints* RenderStyle::scrollSnapPointsY() const 1884 { 1885 return rareNonInheritedData->m_scrollSnapPoints->yPoints.get(); 1897 1886 } 1898 1887 … … 1907 1896 } 1908 1897 1909 void RenderStyle::setScrollSnapPointsX( ScrollSnapPointspoints)1910 { 1911 if (rareNonInheritedData->m_scrollSnapPoints->xPoints == points)1898 void RenderStyle::setScrollSnapPointsX(std::unique_ptr<ScrollSnapPoints> points) 1899 { 1900 if (rareNonInheritedData->m_scrollSnapPoints->xPoints.get() == points.get()) 1912 1901 return; 1913 1902 rareNonInheritedData.access()->m_scrollSnapPoints.access()->xPoints = WTF::move(points); 1914 1903 } 1915 1904 1916 void RenderStyle::setScrollSnapPointsY( ScrollSnapPointspoints)1917 { 1918 if (rareNonInheritedData->m_scrollSnapPoints->yPoints == points)1905 void RenderStyle::setScrollSnapPointsY(std::unique_ptr<ScrollSnapPoints> points) 1906 { 1907 if (rareNonInheritedData->m_scrollSnapPoints->yPoints.get() == points.get()) 1919 1908 return; 1920 1909 rareNonInheritedData.access()->m_scrollSnapPoints.access()->yPoints = WTF::move(points); -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r180689 r181189 1081 1081 #if ENABLE(CSS_SCROLL_SNAP) 1082 1082 ScrollSnapType scrollSnapType() const { return static_cast<ScrollSnapType>(rareNonInheritedData->m_scrollSnapType); } 1083 const ScrollSnapPoints &scrollSnapPointsX() const;1084 const ScrollSnapPoints &scrollSnapPointsY() const;1083 const ScrollSnapPoints* scrollSnapPointsX() const; 1084 const ScrollSnapPoints* scrollSnapPointsY() const; 1085 1085 const LengthSize& scrollSnapDestination() const; 1086 1086 const Vector<LengthSize>& scrollSnapCoordinates() const; … … 1626 1626 #if ENABLE(CSS_SCROLL_SNAP) 1627 1627 void setScrollSnapType(ScrollSnapType type) { SET_VAR(rareNonInheritedData, m_scrollSnapType, static_cast<unsigned>(type)); } 1628 void setScrollSnapPointsX( ScrollSnapPoints);1629 void setScrollSnapPointsY( ScrollSnapPoints);1628 void setScrollSnapPointsX(std::unique_ptr<ScrollSnapPoints>); 1629 void setScrollSnapPointsY(std::unique_ptr<ScrollSnapPoints>); 1630 1630 void setScrollSnapDestination(LengthSize); 1631 1631 void setScrollSnapCoordinates(Vector<LengthSize>); … … 1960 1960 static ImageResolutionSnap initialImageResolutionSnap() { return ImageResolutionNoSnap; } 1961 1961 static float initialImageResolution() { return 1; } 1962 static StyleImage* initialBorderImageSource() { return 0; }1963 static StyleImage* initialMaskBoxImageSource() { return 0; }1962 static StyleImage* initialBorderImageSource() { return nullptr; } 1963 static StyleImage* initialMaskBoxImageSource() { return nullptr; } 1964 1964 static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; } 1965 1965 static QuotesData* initialQuotes() { return nullptr; } … … 1968 1968 #if ENABLE(CSS_SCROLL_SNAP) 1969 1969 static ScrollSnapType initialScrollSnapType() { return ScrollSnapType::None; } 1970 static ScrollSnapPoints initialScrollSnapPointsX();1971 static ScrollSnapPoints initialScrollSnapPointsY();1970 static ScrollSnapPoints* initialScrollSnapPointsX() { return nullptr; } 1971 static ScrollSnapPoints* initialScrollSnapPointsY() { return nullptr; } 1972 1972 static LengthSize initialScrollSnapDestination(); 1973 1973 static Vector<LengthSize> initialScrollSnapCoordinates(); -
trunk/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp
r177259 r181189 58 58 inline StyleScrollSnapPoints::StyleScrollSnapPoints(const StyleScrollSnapPoints& other) 59 59 : RefCounted() 60 , xPoints(other.xPoints )61 , yPoints(other.yPoints )60 , xPoints(other.xPoints ? std::make_unique<ScrollSnapPoints>(*other.xPoints) : nullptr) 61 , yPoints(other.yPoints ? std::make_unique<ScrollSnapPoints>(*other.yPoints) : nullptr) 62 62 , destination(other.destination) 63 63 , coordinates(other.coordinates) -
trunk/Source/WebCore/rendering/style/StyleScrollSnapPoints.h
r177259 r181189 54 54 Ref<StyleScrollSnapPoints> copy() const; 55 55 56 ScrollSnapPointsxPoints;57 ScrollSnapPointsyPoints;56 std::unique_ptr<ScrollSnapPoints> xPoints; 57 std::unique_ptr<ScrollSnapPoints> yPoints; 58 58 LengthSize destination; 59 59 Vector<LengthSize> coordinates;
Note: See TracChangeset
for help on using the changeset viewer.