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

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: Moved BorderImageLength{,Box} to core/rendering/style 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/CSSToStyleMap.h » ('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 * 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 454
455 RefPtr<Quad> quad = Quad::create(); 455 RefPtr<Quad> quad = Quad::create();
456 quad->setTop(top); 456 quad->setTop(top);
457 quad->setRight(right); 457 quad->setRight(right);
458 quad->setBottom(bottom); 458 quad->setBottom(bottom);
459 quad->setLeft(left); 459 quad->setLeft(left);
460 460
461 return CSSBorderImageSliceValue::create(cssValuePool().createValue(quad.rele ase()), image.fill()); 461 return CSSBorderImageSliceValue::create(cssValuePool().createValue(quad.rele ase()), image.fill());
462 } 462 }
463 463
464 static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const LengthBox& box, const RenderStyle* style) 464 static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const BorderImag eLengthBox& box, const RenderStyle* style)
465 { 465 {
466 // Create the slices. 466 // Create the slices.
467 RefPtr<CSSPrimitiveValue> top; 467 RefPtr<CSSPrimitiveValue> top;
468 RefPtr<CSSPrimitiveValue> right; 468 RefPtr<CSSPrimitiveValue> right;
469 RefPtr<CSSPrimitiveValue> bottom; 469 RefPtr<CSSPrimitiveValue> bottom;
470 RefPtr<CSSPrimitiveValue> left; 470 RefPtr<CSSPrimitiveValue> left;
471 471
472 if (box.top().isRelative()) 472 if (box.top().isNumber())
473 top = cssValuePool().createValue(box.top().value(), CSSPrimitiveValue::C SS_NUMBER); 473 top = cssValuePool().createValue(box.top().number(), CSSPrimitiveValue:: CSS_NUMBER);
474 else 474 else
475 top = cssValuePool().createValue(box.top(), style); 475 top = cssValuePool().createValue(box.top().length(), style);
476 476
477 if (box.right() == box.top() && box.bottom() == box.top() && box.left() == b ox.top()) { 477 if (box.right() == box.top() && box.bottom() == box.top() && box.left() == b ox.top()) {
478 right = top; 478 right = top;
479 bottom = top; 479 bottom = top;
480 left = top; 480 left = top;
481 } else { 481 } else {
482 if (box.right().isRelative()) 482 if (box.right().isNumber())
483 right = cssValuePool().createValue(box.right().value(), CSSPrimitive Value::CSS_NUMBER); 483 right = cssValuePool().createValue(box.right().number(), CSSPrimitiv eValue::CSS_NUMBER);
484 else 484 else
485 right = cssValuePool().createValue(box.right(), style); 485 right = cssValuePool().createValue(box.right().length(), style);
486 486
487 if (box.bottom() == box.top() && box.right() == box.left()) { 487 if (box.bottom() == box.top() && box.right() == box.left()) {
488 bottom = top; 488 bottom = top;
489 left = right; 489 left = right;
490 } else { 490 } else {
491 if (box.bottom().isRelative()) 491 if (box.bottom().isNumber())
492 bottom = cssValuePool().createValue(box.bottom().value(), CSSPri mitiveValue::CSS_NUMBER); 492 bottom = cssValuePool().createValue(box.bottom().number(), CSSPr imitiveValue::CSS_NUMBER);
493 else 493 else
494 bottom = cssValuePool().createValue(box.bottom(), style); 494 bottom = cssValuePool().createValue(box.bottom().length(), style );
495 495
496 if (box.left() == box.right()) 496 if (box.left() == box.right())
497 left = right; 497 left = right;
498 else { 498 else {
499 if (box.left().isRelative()) 499 if (box.left().isNumber())
500 left = cssValuePool().createValue(box.left().value(), CSSPri mitiveValue::CSS_NUMBER); 500 left = cssValuePool().createValue(box.left().number(), CSSPr imitiveValue::CSS_NUMBER);
501 else 501 else
502 left = cssValuePool().createValue(box.left(), style); 502 left = cssValuePool().createValue(box.left().length(), style );
503 } 503 }
504 } 504 }
505 } 505 }
506 506
507 RefPtr<Quad> quad = Quad::create(); 507 RefPtr<Quad> quad = Quad::create();
508 quad->setTop(top); 508 quad->setTop(top);
509 quad->setRight(right); 509 quad->setRight(right);
510 quad->setBottom(bottom); 510 quad->setBottom(bottom);
511 quad->setLeft(left); 511 quad->setLeft(left);
512 512
(...skipping 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after
3240 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3240 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3241 CSSPropertyB ackgroundClip }; 3241 CSSPropertyB ackgroundClip };
3242 3242
3243 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 3243 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
3244 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3244 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3245 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3245 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3246 return list.release(); 3246 return list.release();
3247 } 3247 }
3248 3248
3249 } // namespace WebCore 3249 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/CSSToStyleMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698