OLD | NEW |
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 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All |
| 6 * rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * 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/) | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 11 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 12 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
11 * | 13 * |
12 * This library is free software; you can redistribute it and/or | 14 * This library is free software; you can redistribute it and/or |
13 * modify it under the terms of the GNU Library General Public | 15 * modify it under the terms of the GNU Library General Public |
14 * License as published by the Free Software Foundation; either | 16 * License as published by the Free Software Foundation; either |
15 * version 2 of the License, or (at your option) any later version. | 17 * version 2 of the License, or (at your option) any later version. |
16 * | 18 * |
17 * This library is distributed in the hope that it will be useful, | 19 * This library is distributed in the hope that it will be useful, |
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 !allowStepMiddle) | 465 !allowStepMiddle) |
464 return CSSTimingData::initialTimingFunction(); | 466 return CSSTimingData::initialTimingFunction(); |
465 return StepsTimingFunction::create(stepsTimingFunction.numberOfSteps(), | 467 return StepsTimingFunction::create(stepsTimingFunction.numberOfSteps(), |
466 stepsTimingFunction.getStepPosition()); | 468 stepsTimingFunction.getStepPosition()); |
467 } | 469 } |
468 | 470 |
469 void CSSToStyleMap::mapNinePieceImage(StyleResolverState& state, | 471 void CSSToStyleMap::mapNinePieceImage(StyleResolverState& state, |
470 CSSPropertyID property, | 472 CSSPropertyID property, |
471 const CSSValue& value, | 473 const CSSValue& value, |
472 NinePieceImage& image) { | 474 NinePieceImage& image) { |
473 // If we're not a value list, then we are "none" and don't need to alter the e
mpty image at all. | 475 // If we're not a value list, then we are "none" and don't need to alter the |
| 476 // empty image at all. |
474 if (!value.isValueList()) | 477 if (!value.isValueList()) |
475 return; | 478 return; |
476 | 479 |
477 // Retrieve the border image value. | 480 // Retrieve the border image value. |
478 const CSSValueList& borderImage = toCSSValueList(value); | 481 const CSSValueList& borderImage = toCSSValueList(value); |
479 | 482 |
480 // Set the image (this kicks off the load). | 483 // Set the image (this kicks off the load). |
481 CSSPropertyID imageProperty; | 484 CSSPropertyID imageProperty; |
482 if (property == CSSPropertyWebkitBorderImage) | 485 if (property == CSSPropertyWebkitBorderImage) |
483 imageProperty = CSSPropertyBorderImageSource; | 486 imageProperty = CSSPropertyBorderImageSource; |
(...skipping 24 matching lines...) Expand all Loading... |
508 // Map in the outset. | 511 // Map in the outset. |
509 if (length > 2) | 512 if (length > 2) |
510 image.setOutset(mapNinePieceImageQuad(state, slashList.item(2))); | 513 image.setOutset(mapNinePieceImageQuad(state, slashList.item(2))); |
511 } else if (current.isPrimitiveValue() || current.isValuePair()) { | 514 } else if (current.isPrimitiveValue() || current.isValuePair()) { |
512 // Set the appropriate rules for stretch/round/repeat of the slices. | 515 // Set the appropriate rules for stretch/round/repeat of the slices. |
513 mapNinePieceImageRepeat(state, current, image); | 516 mapNinePieceImageRepeat(state, current, image); |
514 } | 517 } |
515 } | 518 } |
516 | 519 |
517 if (property == CSSPropertyWebkitBorderImage) { | 520 if (property == CSSPropertyWebkitBorderImage) { |
518 // We have to preserve the legacy behavior of -webkit-border-image and make
the border slices | 521 // We have to preserve the legacy behavior of -webkit-border-image and make |
519 // also set the border widths. We don't need to worry about percentages, sin
ce we don't even support | 522 // the border slices also set the border widths. We don't need to worry |
520 // those on real borders yet. | 523 // about percentages, since we don't even support those on real borders yet. |
521 if (image.borderSlices().top().isLength() && | 524 if (image.borderSlices().top().isLength() && |
522 image.borderSlices().top().length().isFixed()) | 525 image.borderSlices().top().length().isFixed()) |
523 state.style()->setBorderTopWidth( | 526 state.style()->setBorderTopWidth( |
524 image.borderSlices().top().length().value()); | 527 image.borderSlices().top().length().value()); |
525 if (image.borderSlices().right().isLength() && | 528 if (image.borderSlices().right().isLength() && |
526 image.borderSlices().right().length().isFixed()) | 529 image.borderSlices().right().length().isFixed()) |
527 state.style()->setBorderRightWidth( | 530 state.style()->setBorderRightWidth( |
528 image.borderSlices().right().length().value()); | 531 image.borderSlices().right().length().value()); |
529 if (image.borderSlices().bottom().isLength() && | 532 if (image.borderSlices().bottom().isLength() && |
530 image.borderSlices().bottom().length().isFixed()) | 533 image.borderSlices().bottom().length().isFixed()) |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 verticalRule = SpaceImageRule; | 642 verticalRule = SpaceImageRule; |
640 break; | 643 break; |
641 default: // CSSValueRepeat | 644 default: // CSSValueRepeat |
642 verticalRule = RepeatImageRule; | 645 verticalRule = RepeatImageRule; |
643 break; | 646 break; |
644 } | 647 } |
645 image.setVerticalRule(verticalRule); | 648 image.setVerticalRule(verticalRule); |
646 } | 649 } |
647 | 650 |
648 } // namespace blink | 651 } // namespace blink |
OLD | NEW |