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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Issue 2209773002: Remove the blocking touch handlers for the input[type=range] and add touch-action instead (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style.. Created 4 years, 4 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) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1438 const String& name = toCSSCustomIdentValue(value).value(); 1438 const String& name = toCSSCustomIdentValue(value).value();
1439 const StylePropertySet* propertySet = state.customPropertySetForApplyAtRule( name); 1439 const StylePropertySet* propertySet = state.customPropertySetForApplyAtRule( name);
1440 if (propertySet) 1440 if (propertySet)
1441 applyProperties<priority>(state, propertySet, isImportant, inheritedOnly , propertyWhitelistType); 1441 applyProperties<priority>(state, propertySet, isImportant, inheritedOnly , propertyWhitelistType);
1442 } 1442 }
1443 1443
1444 template <CSSPropertyPriority priority> 1444 template <CSSPropertyPriority priority>
1445 void StyleResolver::applyProperties(StyleResolverState& state, const StyleProper tySet* properties, bool isImportant, bool inheritedOnly, PropertyWhitelistType p ropertyWhitelistType) 1445 void StyleResolver::applyProperties(StyleResolverState& state, const StyleProper tySet* properties, bool isImportant, bool inheritedOnly, PropertyWhitelistType p ropertyWhitelistType)
1446 { 1446 {
1447 unsigned propertyCount = properties->propertyCount(); 1447 unsigned propertyCount = properties->propertyCount();
1448 bool hasTouchAction = false;
1448 for (unsigned i = 0; i < propertyCount; ++i) { 1449 for (unsigned i = 0; i < propertyCount; ++i) {
1449 StylePropertySet::PropertyReference current = properties->propertyAt(i); 1450 StylePropertySet::PropertyReference current = properties->propertyAt(i);
1450 CSSPropertyID property = current.id(); 1451 CSSPropertyID property = current.id();
1451 1452
1452 if (property == CSSPropertyApplyAtRule) { 1453 if (property == CSSPropertyApplyAtRule) {
1453 applyPropertiesForApplyAtRule<priority>(state, current.value(), isIm portant, inheritedOnly, propertyWhitelistType); 1454 applyPropertiesForApplyAtRule<priority>(state, current.value(), isIm portant, inheritedOnly, propertyWhitelistType);
1454 continue; 1455 continue;
1455 } 1456 }
1456 1457
1457 if (isImportant != current.isImportant()) 1458 if (isImportant != current.isImportant())
(...skipping 11 matching lines...) Expand all
1469 // If the property value is explicitly inherited, we need to apply f urther non-inherited properties 1470 // If the property value is explicitly inherited, we need to apply f urther non-inherited properties
1470 // as they might override the value inherited here. For this reason we don't allow declarations with 1471 // as they might override the value inherited here. For this reason we don't allow declarations with
1471 // explicitly inherited properties to be cached. 1472 // explicitly inherited properties to be cached.
1472 DCHECK(!current.value().isInheritedValue()); 1473 DCHECK(!current.value().isInheritedValue());
1473 continue; 1474 continue;
1474 } 1475 }
1475 1476
1476 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property)) 1477 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property))
1477 continue; 1478 continue;
1478 1479
1480 if (property == CSSPropertyTouchAction) {
1481 hasTouchAction = true;
1482 }
1483
1479 StyleBuilder::applyProperty(current.id(), state, current.value()); 1484 StyleBuilder::applyProperty(current.id(), state, current.value());
1485
1486 if (property == CSSPropertyWebkitAppearance && !hasTouchAction) {
tkent 2016/08/09 00:29:46 This code looks like the state.style() will have t
1487 if (state.style()->appearance() == SliderVerticalPart) {
1488 state.style()->setTouchAction(TouchActionPanX);
1489 }
1490 if (state.style()->appearance() == SliderHorizontalPart) {
1491 state.style()->setTouchAction(TouchActionPanY);
1492 }
1493 }
1480 } 1494 }
1481 } 1495 }
1482 1496
1483 template <CSSPropertyPriority priority> 1497 template <CSSPropertyPriority priority>
1484 void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc hedPropertiesRange& range, bool isImportant, bool inheritedOnly) 1498 void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc hedPropertiesRange& range, bool isImportant, bool inheritedOnly)
1485 { 1499 {
1486 if (range.isEmpty()) 1500 if (range.isEmpty())
1487 return; 1501 return;
1488 1502
1489 if (state.style()->insideLink() != NotInsideLink) { 1503 if (state.style()->insideLink() != NotInsideLink) {
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 visitor->trace(m_siblingRuleSet); 1757 visitor->trace(m_siblingRuleSet);
1744 visitor->trace(m_uncommonAttributeRuleSet); 1758 visitor->trace(m_uncommonAttributeRuleSet);
1745 visitor->trace(m_watchedSelectorsRules); 1759 visitor->trace(m_watchedSelectorsRules);
1746 visitor->trace(m_treeBoundaryCrossingScopes); 1760 visitor->trace(m_treeBoundaryCrossingScopes);
1747 visitor->trace(m_styleSharingLists); 1761 visitor->trace(m_styleSharingLists);
1748 visitor->trace(m_pendingStyleSheets); 1762 visitor->trace(m_pendingStyleSheets);
1749 visitor->trace(m_document); 1763 visitor->trace(m_document);
1750 } 1764 }
1751 1765
1752 } // namespace blink 1766 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698