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

Side by Side Diff: sky/engine/core/css/StylePropertySerializer.cpp

Issue 892903002: Remove -webkit-mask-*. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix goofups Created 5 years, 10 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
« no previous file with comments | « sky/engine/core/css/CSSProperties.in ('k') | sky/engine/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * Copyright (C) 2013 Intel Corporation. All rights reserved. 5 * Copyright (C) 2013 Intel Corporation. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 break; 173 break;
174 case CSSPropertyFlexDirection: 174 case CSSPropertyFlexDirection:
175 case CSSPropertyFlexWrap: 175 case CSSPropertyFlexWrap:
176 shorthandPropertyID = CSSPropertyFlexFlow; 176 shorthandPropertyID = CSSPropertyFlexFlow;
177 break; 177 break;
178 case CSSPropertyFlexBasis: 178 case CSSPropertyFlexBasis:
179 case CSSPropertyFlexGrow: 179 case CSSPropertyFlexGrow:
180 case CSSPropertyFlexShrink: 180 case CSSPropertyFlexShrink:
181 shorthandPropertyID = CSSPropertyFlex; 181 shorthandPropertyID = CSSPropertyFlex;
182 break; 182 break;
183 case CSSPropertyWebkitMaskPositionX:
184 case CSSPropertyWebkitMaskPositionY:
185 case CSSPropertyWebkitMaskRepeatX:
186 case CSSPropertyWebkitMaskRepeatY:
187 case CSSPropertyWebkitMaskImage:
188 case CSSPropertyWebkitMaskRepeat:
189 case CSSPropertyWebkitMaskPosition:
190 case CSSPropertyWebkitMaskClip:
191 case CSSPropertyWebkitMaskOrigin:
192 shorthandPropertyID = CSSPropertyWebkitMask;
193 break;
194 case CSSPropertyWebkitTransformOriginX: 183 case CSSPropertyWebkitTransformOriginX:
195 case CSSPropertyWebkitTransformOriginY: 184 case CSSPropertyWebkitTransformOriginY:
196 case CSSPropertyWebkitTransformOriginZ: 185 case CSSPropertyWebkitTransformOriginZ:
197 shorthandPropertyID = CSSPropertyWebkitTransformOrigin; 186 shorthandPropertyID = CSSPropertyWebkitTransformOrigin;
198 break; 187 break;
199 default: 188 default:
200 break; 189 break;
201 } 190 }
202 191
203 unsigned shortPropertyIndex = shorthandPropertyID - firstCSSProperty; 192 unsigned shortPropertyIndex = shorthandPropertyID - firstCSSProperty;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 case CSSPropertyMargin: 260 case CSSPropertyMargin:
272 return get4Values(marginShorthand()); 261 return get4Values(marginShorthand());
273 case CSSPropertyOverflow: 262 case CSSPropertyOverflow:
274 return getCommonValue(overflowShorthand()); 263 return getCommonValue(overflowShorthand());
275 case CSSPropertyPadding: 264 case CSSPropertyPadding:
276 return get4Values(paddingShorthand()); 265 return get4Values(paddingShorthand());
277 case CSSPropertyTransition: 266 case CSSPropertyTransition:
278 return getLayeredShorthandValue(transitionShorthand()); 267 return getLayeredShorthandValue(transitionShorthand());
279 case CSSPropertyListStyle: 268 case CSSPropertyListStyle:
280 return getShorthandValue(listStyleShorthand()); 269 return getShorthandValue(listStyleShorthand());
281 case CSSPropertyWebkitMaskPosition:
282 return getLayeredShorthandValue(webkitMaskPositionShorthand());
283 case CSSPropertyWebkitMaskRepeat:
284 return getLayeredShorthandValue(webkitMaskRepeatShorthand());
285 case CSSPropertyWebkitMask:
286 return getLayeredShorthandValue(webkitMaskShorthand());
287 case CSSPropertyWebkitTextEmphasis: 270 case CSSPropertyWebkitTextEmphasis:
288 return getShorthandValue(webkitTextEmphasisShorthand()); 271 return getShorthandValue(webkitTextEmphasisShorthand());
289 case CSSPropertyWebkitTextStroke: 272 case CSSPropertyWebkitTextStroke:
290 return getShorthandValue(webkitTextStrokeShorthand()); 273 return getShorthandValue(webkitTextStrokeShorthand());
291 case CSSPropertyTransformOrigin: 274 case CSSPropertyTransformOrigin:
292 case CSSPropertyWebkitTransformOrigin: 275 case CSSPropertyWebkitTransformOrigin:
293 return getShorthandValue(webkitTransformOriginShorthand()); 276 return getShorthandValue(webkitTransformOriginShorthand());
294 case CSSPropertyBorderRadius: 277 case CSSPropertyBorderRadius:
295 return get4Values(borderRadiusShorthand()); 278 return get4Values(borderRadiusShorthand());
296 default: 279 default:
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 } else if (i) { 464 } else if (i) {
482 // Other singletons only belong in the first layer. 465 // Other singletons only belong in the first layer.
483 value = nullptr; 466 value = nullptr;
484 } 467 }
485 } 468 }
486 } 469 }
487 470
488 // We need to report background-repeat as it was written in the CSS. If the property is implicit, 471 // We need to report background-repeat as it was written in the CSS. If the property is implicit,
489 // then it was written with only one value. Here we figure out which value that was so we can 472 // then it was written with only one value. Here we figure out which value that was so we can
490 // report back correctly. 473 // report back correctly.
491 if ((shorthand.properties()[j] == CSSPropertyBackgroundRepeatX && m_ propertySet.isPropertyImplicit(shorthand.properties()[j])) 474 if (shorthand.properties()[j] == CSSPropertyBackgroundRepeatX && m_p ropertySet.isPropertyImplicit(shorthand.properties()[j])) {
492 || (shorthand.properties()[j] == CSSPropertyWebkitMaskRepeatX && m_propertySet.isPropertyImplicit(shorthand.properties()[j]))) {
493 475
494 // BUG 49055: make sure the value was not reset in the layer che ck just above. 476 // BUG 49055: make sure the value was not reset in the layer che ck just above.
495 if ((j < size - 1 && shorthand.properties()[j + 1] == CSSPropert yBackgroundRepeatY && value) 477 if (j < size - 1 && shorthand.properties()[j + 1] == CSSProperty BackgroundRepeatY && value) {
496 || (j < size - 1 && shorthand.properties()[j + 1] == CSSProp ertyWebkitMaskRepeatY && value)) {
497 RefPtr<CSSValue> yValue = nullptr; 478 RefPtr<CSSValue> yValue = nullptr;
498 RefPtr<CSSValue> nextValue = values[j + 1]; 479 RefPtr<CSSValue> nextValue = values[j + 1];
499 if (nextValue->isValueList()) 480 if (nextValue->isValueList())
500 yValue = toCSSValueList(nextValue.get())->item(i); 481 yValue = toCSSValueList(nextValue.get())->item(i);
501 else 482 else
502 yValue = nextValue; 483 yValue = nextValue;
503 484
504 // background-repeat-x(y) or mask-repeat-x(y) may be like th is : "initial, repeat". We can omit the implicit initial values 485 // background-repeat-x(y) or mask-repeat-x(y) may be like th is : "initial, repeat". We can omit the implicit initial values
505 // before starting to compare their values. 486 // before starting to compare their values.
506 if (value->isImplicitInitialValue() || yValue->isImplicitIni tialValue()) 487 if (value->isImplicitInitialValue() || yValue->isImplicitIni tialValue())
(...skipping 19 matching lines...) Expand all
526 ++j; 507 ++j;
527 } 508 }
528 } 509 }
529 } 510 }
530 511
531 String valueText; 512 String valueText;
532 if (value && !value->isImplicitInitialValue()) { 513 if (value && !value->isImplicitInitialValue()) {
533 if (!layerResult.isEmpty()) 514 if (!layerResult.isEmpty())
534 layerResult.append(' '); 515 layerResult.append(' ');
535 if (foundPositionYCSSProperty 516 if (foundPositionYCSSProperty
536 && (shorthand.properties()[j] == CSSPropertyBackgroundSize | | shorthand.properties()[j] == CSSPropertyWebkitMaskSize)) 517 && shorthand.properties()[j] == CSSPropertyBackgroundSize)
537 layerResult.appendLiteral("/ "); 518 layerResult.appendLiteral("/ ");
538 if (!foundPositionYCSSProperty 519 if (!foundPositionYCSSProperty
539 && (shorthand.properties()[j] == CSSPropertyBackgroundSize | | shorthand.properties()[j] == CSSPropertyWebkitMaskSize)) 520 && shorthand.properties()[j] == CSSPropertyBackgroundSize)
540 continue; 521 continue;
541 522
542 if (useRepeatXShorthand) { 523 if (useRepeatXShorthand) {
543 useRepeatXShorthand = false; 524 useRepeatXShorthand = false;
544 layerResult.append(getValueName(CSSValueRepeatX)); 525 layerResult.append(getValueName(CSSValueRepeatX));
545 } else if (useRepeatYShorthand) { 526 } else if (useRepeatYShorthand) {
546 useRepeatYShorthand = false; 527 useRepeatYShorthand = false;
547 layerResult.append(getValueName(CSSValueRepeatY)); 528 layerResult.append(getValueName(CSSValueRepeatY));
548 } else { 529 } else {
549 if (useSingleWordShorthand) 530 if (useSingleWordShorthand)
550 useSingleWordShorthand = false; 531 useSingleWordShorthand = false;
551 valueText = value->cssText(); 532 valueText = value->cssText();
552 layerResult.append(valueText); 533 layerResult.append(valueText);
553 } 534 }
554 535
555 if (shorthand.properties()[j] == CSSPropertyBackgroundPositionY 536 if (shorthand.properties()[j] == CSSPropertyBackgroundPositionY) {
556 || shorthand.properties()[j] == CSSPropertyWebkitMaskPositio nY) {
557 foundPositionYCSSProperty = true; 537 foundPositionYCSSProperty = true;
558 538
559 // background-position is a special case: if only the first offset is specified, 539 // background-position is a special case: if only the first offset is specified,
560 // the second one defaults to "center", not the same value. 540 // the second one defaults to "center", not the same value.
561 if (commonValueInitialized && commonValue != "initial" && co mmonValue != "inherit") 541 if (commonValueInitialized && commonValue != "initial" && co mmonValue != "inherit")
562 commonValue = String(); 542 commonValue = String();
563 } 543 }
564 } 544 }
565 545
566 if (!commonValueInitialized) { 546 if (!commonValueInitialized) {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 return false; 790 return false;
811 if (!value->isInitialValue()) 791 if (!value->isInitialValue())
812 isInitialValue = false; 792 isInitialValue = false;
813 if (!value->isInheritedValue()) 793 if (!value->isInheritedValue())
814 isInheritedValue = false; 794 isInheritedValue = false;
815 } 795 }
816 return isInitialValue || isInheritedValue; 796 return isInitialValue || isInheritedValue;
817 } 797 }
818 798
819 } 799 }
OLDNEW
« no previous file with comments | « sky/engine/core/css/CSSProperties.in ('k') | sky/engine/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698