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

Side by Side Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 55783002: Introduce BorderImageLength and BorderImageLengthBox (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 456
457 RefPtr<Quad> quad = Quad::create(); 457 RefPtr<Quad> quad = Quad::create();
458 quad->setTop(top); 458 quad->setTop(top);
459 quad->setRight(right); 459 quad->setRight(right);
460 quad->setBottom(bottom); 460 quad->setBottom(bottom);
461 quad->setLeft(left); 461 quad->setLeft(left);
462 462
463 return CSSBorderImageSliceValue::create(cssValuePool().createValue(quad.rele ase()), image.fill()); 463 return CSSBorderImageSliceValue::create(cssValuePool().createValue(quad.rele ase()), image.fill());
464 } 464 }
465 465
466 static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const LengthBox& box, const RenderStyle* style) 466 static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const LengthOrNu mberBox& box, const RenderStyle* style)
467 { 467 {
468 // Create the slices. 468 // Create the slices.
469 RefPtr<CSSPrimitiveValue> top; 469 RefPtr<CSSPrimitiveValue> top;
470 RefPtr<CSSPrimitiveValue> right; 470 RefPtr<CSSPrimitiveValue> right;
471 RefPtr<CSSPrimitiveValue> bottom; 471 RefPtr<CSSPrimitiveValue> bottom;
472 RefPtr<CSSPrimitiveValue> left; 472 RefPtr<CSSPrimitiveValue> left;
473 473
474 if (box.top().isRelative()) 474 if (box.top().isNumber())
475 top = cssValuePool().createValue(box.top().value(), CSSPrimitiveValue::C SS_NUMBER); 475 top = cssValuePool().createValue(box.top().number(), CSSPrimitiveValue:: CSS_NUMBER);
476 else 476 else
477 top = cssValuePool().createValue(box.top(), style); 477 top = cssValuePool().createValue(box.top().length(), style);
Julien - ping for review 2013/11/01 18:27:11 Maybe be worth considering having a LengthOrNumber
davve 2013/11/04 12:42:54 Sure. I've put it on my todo for a later CL.
478 478
479 if (box.right() == box.top() && box.bottom() == box.top() && box.left() == b ox.top()) { 479 if (box.right() == box.top() && box.bottom() == box.top() && box.left() == b ox.top()) {
480 right = top; 480 right = top;
481 bottom = top; 481 bottom = top;
482 left = top; 482 left = top;
483 } else { 483 } else {
484 if (box.right().isRelative()) 484 if (box.right().isNumber())
485 right = cssValuePool().createValue(box.right().value(), CSSPrimitive Value::CSS_NUMBER); 485 right = cssValuePool().createValue(box.right().number(), CSSPrimitiv eValue::CSS_NUMBER);
486 else 486 else
487 right = cssValuePool().createValue(box.right(), style); 487 right = cssValuePool().createValue(box.right().length(), style);
488 488
489 if (box.bottom() == box.top() && box.right() == box.left()) { 489 if (box.bottom() == box.top() && box.right() == box.left()) {
490 bottom = top; 490 bottom = top;
491 left = right; 491 left = right;
492 } else { 492 } else {
493 if (box.bottom().isRelative()) 493 if (box.bottom().isNumber())
494 bottom = cssValuePool().createValue(box.bottom().value(), CSSPri mitiveValue::CSS_NUMBER); 494 bottom = cssValuePool().createValue(box.bottom().number(), CSSPr imitiveValue::CSS_NUMBER);
495 else 495 else
496 bottom = cssValuePool().createValue(box.bottom(), style); 496 bottom = cssValuePool().createValue(box.bottom().length(), style );
497 497
498 if (box.left() == box.right()) 498 if (box.left() == box.right())
499 left = right; 499 left = right;
500 else { 500 else {
501 if (box.left().isRelative()) 501 if (box.left().isNumber())
502 left = cssValuePool().createValue(box.left().value(), CSSPri mitiveValue::CSS_NUMBER); 502 left = cssValuePool().createValue(box.left().number(), CSSPr imitiveValue::CSS_NUMBER);
503 else 503 else
504 left = cssValuePool().createValue(box.left(), style); 504 left = cssValuePool().createValue(box.left().length(), style );
505 } 505 }
506 } 506 }
507 } 507 }
508 508
509 RefPtr<Quad> quad = Quad::create(); 509 RefPtr<Quad> quad = Quad::create();
510 quad->setTop(top); 510 quad->setTop(top);
511 quad->setRight(right); 511 quad->setRight(right);
512 quad->setBottom(bottom); 512 quad->setBottom(bottom);
513 quad->setLeft(left); 513 quad->setLeft(left);
514 514
(...skipping 2710 matching lines...) Expand 10 before | Expand all | Expand 10 after
3225 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3225 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3226 CSSPropertyB ackgroundClip }; 3226 CSSPropertyB ackgroundClip };
3227 3227
3228 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 3228 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
3229 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3229 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3230 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3230 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3231 return list.release(); 3231 return list.release();
3232 } 3232 }
3233 3233
3234 } // namespace WebCore 3234 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698