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

Side by Side Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 723373006: Add CSS parsing support for the scroll-blocks-on property (in place of touch-action-delay) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1476 validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg)) ; 1476 validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg)) ;
1477 break; 1477 break;
1478 case CSSPropertyShapeImageThreshold: 1478 case CSSPropertyShapeImageThreshold:
1479 validPrimitive = (!id && validUnit(value, FNumber)); 1479 validPrimitive = (!id && validUnit(value, FNumber));
1480 break; 1480 break;
1481 1481
1482 case CSSPropertyTouchAction: 1482 case CSSPropertyTouchAction:
1483 parsedValue = parseTouchAction(); 1483 parsedValue = parseTouchAction();
1484 break; 1484 break;
1485 1485
1486 case CSSPropertyScrollBlocksOn:
1487 parsedValue = parseScrollBlocksOn();
1488 break;
1489
1486 case CSSPropertyAlignSelf: 1490 case CSSPropertyAlignSelf:
1487 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 1491 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
1488 return parseItemPositionOverflowPosition(propId, important); 1492 return parseItemPositionOverflowPosition(propId, important);
1489 1493
1490 case CSSPropertyAlignItems: 1494 case CSSPropertyAlignItems:
1491 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 1495 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
1492 return parseItemPositionOverflowPosition(propId, important); 1496 return parseItemPositionOverflowPosition(propId, important);
1493 1497
1494 // Properties below are validated inside parseViewportProperty, because we 1498 // Properties below are validated inside parseViewportProperty, because we
1495 // check for parser state. We need to invalidate if someone adds them outsid e 1499 // check for parser state. We need to invalidate if someone adds them outsid e
(...skipping 5882 matching lines...) Expand 10 before | Expand all | Expand 10 after
7378 } 7382 }
7379 value = m_valueList->next(); 7383 value = m_valueList->next();
7380 } 7384 }
7381 7385
7382 if (list->length()) 7386 if (list->length())
7383 return list.release(); 7387 return list.release();
7384 7388
7385 return nullptr; 7389 return nullptr;
7386 } 7390 }
7387 7391
7392 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseScrollBlocksOn()
7393 {
7394 CSSParserValue* value = m_valueList->current();
7395 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ;
7396 if (m_valueList->size() == 1 && value && (value->id == CSSValueNone)) {
Timothy Loh 2014/11/14 22:06:41 I'm pretty sure we don't need to check the size (c
Rick Byers 2014/11/18 03:03:08 Done.
7397 list->append(cssValuePool().createIdentifierValue(CSSValueNone));
7398 m_valueList->next();
7399 return list.release();
7400 }
7401
7402 while (value) {
7403 switch (value->id) {
7404 case CSSValueStartTouch:
7405 case CSSValueWheelEvent:
7406 case CSSValueScrollEvent: {
7407 RefPtrWillBeRawPtr<CSSValue> flagValue = cssValuePool().createIdenti fierValue(value->id);
7408 if (list->hasValue(flagValue.get()))
7409 return nullptr;
7410 list->append(flagValue.release());
7411 break;
7412 }
7413 default:
7414 return nullptr;
7415 }
7416 value = m_valueList->next();
7417 }
7418
7419 if (list->length())
Timothy Loh 2014/11/14 22:06:41 Since value is never null when we get into this fu
Rick Byers 2014/11/18 03:03:08 Done.
7420 return list.release();
7421
7422 return nullptr;
7423 }
7424
7388 void CSSPropertyParser::addTextDecorationProperty(CSSPropertyID propId, PassRefP trWillBeRawPtr<CSSValue> value, bool important) 7425 void CSSPropertyParser::addTextDecorationProperty(CSSPropertyID propId, PassRefP trWillBeRawPtr<CSSValue> value, bool important)
7389 { 7426 {
7390 // The text-decoration-line property takes priority over text-decoration, un less the latter has important priority set. 7427 // The text-decoration-line property takes priority over text-decoration, un less the latter has important priority set.
7391 if (propId == CSSPropertyTextDecoration && !important && !inShorthand()) { 7428 if (propId == CSSPropertyTextDecoration && !important && !inShorthand()) {
7392 for (unsigned i = 0; i < m_parsedProperties.size(); ++i) { 7429 for (unsigned i = 0; i < m_parsedProperties.size(); ++i) {
7393 if (m_parsedProperties[i].id() == CSSPropertyTextDecorationLine) 7430 if (m_parsedProperties[i].id() == CSSPropertyTextDecorationLine)
7394 return; 7431 return;
7395 } 7432 }
7396 } 7433 }
7397 addProperty(propId, value, important); 7434 addProperty(propId, value, important);
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
8427 return nullptr; 8464 return nullptr;
8428 a = args->next(); 8465 a = args->next();
8429 8466
8430 argNumber++; 8467 argNumber++;
8431 } 8468 }
8432 8469
8433 return transformValue.release(); 8470 return transformValue.release();
8434 } 8471 }
8435 8472
8436 } // namespace blink 8473 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698