OLD | NEW |
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 * Copyright (C) 2015 Google Inc. All rights reserved. | 7 * Copyright (C) 2015 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 return cssValuePool().createValue(CSSValueAlpha); | 143 return cssValuePool().createValue(CSSValueAlpha); |
144 case MaskLuminance: | 144 case MaskLuminance: |
145 return cssValuePool().createValue(CSSValueLuminance); | 145 return cssValuePool().createValue(CSSValueLuminance); |
146 } | 146 } |
147 | 147 |
148 ASSERT_NOT_REACHED(); | 148 ASSERT_NOT_REACHED(); |
149 | 149 |
150 return nullptr; | 150 return nullptr; |
151 } | 151 } |
152 | 152 |
153 static PassRefPtrWillBeRawPtr<CSSValue> valueForPositionOffset(const ComputedSty
le& style, CSSPropertyID propertyID, const LayoutObject* renderer) | 153 static PassRefPtrWillBeRawPtr<CSSValue> valueForPositionOffset(const ComputedSty
le& style, CSSPropertyID propertyID, const LayoutObject* layoutObject) |
154 { | 154 { |
155 Length offset; | 155 Length offset; |
156 switch (propertyID) { | 156 switch (propertyID) { |
157 case CSSPropertyLeft: | 157 case CSSPropertyLeft: |
158 offset = style.left(); | 158 offset = style.left(); |
159 break; | 159 break; |
160 case CSSPropertyRight: | 160 case CSSPropertyRight: |
161 offset = style.right(); | 161 offset = style.right(); |
162 break; | 162 break; |
163 case CSSPropertyTop: | 163 case CSSPropertyTop: |
164 offset = style.top(); | 164 offset = style.top(); |
165 break; | 165 break; |
166 case CSSPropertyBottom: | 166 case CSSPropertyBottom: |
167 offset = style.bottom(); | 167 offset = style.bottom(); |
168 break; | 168 break; |
169 default: | 169 default: |
170 return nullptr; | 170 return nullptr; |
171 } | 171 } |
172 | 172 |
173 if (offset.isPercent() && renderer && renderer->isBox() && renderer->isPosit
ioned()) { | 173 if (offset.isPercent() && layoutObject && layoutObject->isBox() && layoutObj
ect->isPositioned()) { |
174 LayoutUnit containingBlockSize = (propertyID == CSSPropertyLeft || prope
rtyID == CSSPropertyRight) ? | 174 LayoutUnit containingBlockSize = (propertyID == CSSPropertyLeft || prope
rtyID == CSSPropertyRight) ? |
175 toLayoutBox(renderer)->containingBlockLogicalWidthForContent() : | 175 toLayoutBox(layoutObject)->containingBlockLogicalWidthForContent() : |
176 toLayoutBox(renderer)->containingBlockLogicalHeightForGetComputedSty
le(); | 176 toLayoutBox(layoutObject)->containingBlockLogicalHeightForGetCompute
dStyle(); |
177 return zoomAdjustedPixelValue(valueForLength(offset, containingBlockSize
), style); | 177 return zoomAdjustedPixelValue(valueForLength(offset, containingBlockSize
), style); |
178 } | 178 } |
179 if (offset.isAuto()) { | 179 if (offset.isAuto()) { |
180 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. | 180 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. |
181 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). | 181 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). |
182 // So we should get the opposite length unit and see if it is auto. | 182 // So we should get the opposite length unit and see if it is auto. |
183 return cssValuePool().createIdentifierValue(CSSValueAuto); | 183 return cssValuePool().createIdentifierValue(CSSValueAuto); |
184 } | 184 } |
185 | 185 |
186 return zoomAdjustedPixelValueForLength(offset, style); | 186 return zoomAdjustedPixelValueForLength(offset, style); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 RefPtrWillBeRawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated
(); | 389 RefPtrWillBeRawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated
(); |
390 if (positionType == LegacyPosition) | 390 if (positionType == LegacyPosition) |
391 result->append(CSSPrimitiveValue::createIdentifier(CSSValueLegacy)); | 391 result->append(CSSPrimitiveValue::createIdentifier(CSSValueLegacy)); |
392 result->append(CSSPrimitiveValue::create(itemPosition)); | 392 result->append(CSSPrimitiveValue::create(itemPosition)); |
393 if (itemPosition >= ItemPositionCenter && overflowAlignment != OverflowAlign
mentDefault) | 393 if (itemPosition >= ItemPositionCenter && overflowAlignment != OverflowAlign
mentDefault) |
394 result->append(CSSPrimitiveValue::create(overflowAlignment)); | 394 result->append(CSSPrimitiveValue::create(overflowAlignment)); |
395 ASSERT(result->length() <= 2); | 395 ASSERT(result->length() <= 2); |
396 return result.release(); | 396 return result.release(); |
397 } | 397 } |
398 | 398 |
399 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForGridShorthand(const StylePr
opertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* rend
erer, Node* styledNode, bool allowVisitedStyle) | 399 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForGridShorthand(const StylePr
opertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* layo
utObject, Node* styledNode, bool allowVisitedStyle) |
400 { | 400 { |
401 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated()
; | 401 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated()
; |
402 for (size_t i = 0; i < shorthand.length(); ++i) { | 402 for (size_t i = 0; i < shorthand.length(); ++i) { |
403 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(s
horthand.properties()[i], style, renderer, styledNode, allowVisitedStyle); | 403 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(s
horthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle); |
404 ASSERT(value); | 404 ASSERT(value); |
405 list->append(value.release()); | 405 list->append(value.release()); |
406 } | 406 } |
407 return list.release(); | 407 return list.release(); |
408 } | 408 } |
409 | 409 |
410 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForShorthandProperty(const Sty
lePropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject*
renderer, Node* styledNode, bool allowVisitedStyle) | 410 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForShorthandProperty(const Sty
lePropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject*
layoutObject, Node* styledNode, bool allowVisitedStyle) |
411 { | 411 { |
412 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 412 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
413 for (size_t i = 0; i < shorthand.length(); ++i) { | 413 for (size_t i = 0; i < shorthand.length(); ++i) { |
414 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(s
horthand.properties()[i], style, renderer, styledNode, allowVisitedStyle); | 414 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(s
horthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle); |
415 ASSERT(value); | 415 ASSERT(value); |
416 list->append(value); | 416 list->append(value); |
417 } | 417 } |
418 return list.release(); | 418 return list.release(); |
419 } | 419 } |
420 | 420 |
421 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBackgroundShorthand(const C
omputedStyle& style, const LayoutObject* renderer, Node* styledNode, bool allowV
isitedStyle) | 421 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBackgroundShorthand(const C
omputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool al
lowVisitedStyle) |
422 { | 422 { |
423 RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); | 423 RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); |
424 const FillLayer* currLayer = &style.backgroundLayers(); | 424 const FillLayer* currLayer = &style.backgroundLayers(); |
425 for (; currLayer; currLayer = currLayer->next()) { | 425 for (; currLayer; currLayer = currLayer->next()) { |
426 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparat
ed(); | 426 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparat
ed(); |
427 RefPtrWillBeRawPtr<CSSValueList> beforeSlash = CSSValueList::createSpace
Separated(); | 427 RefPtrWillBeRawPtr<CSSValueList> beforeSlash = CSSValueList::createSpace
Separated(); |
428 if (!currLayer->next()) { // color only for final layer | 428 if (!currLayer->next()) { // color only for final layer |
429 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::g
et(CSSPropertyBackgroundColor, style, renderer, styledNode, allowVisitedStyle); | 429 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::g
et(CSSPropertyBackgroundColor, style, layoutObject, styledNode, allowVisitedStyl
e); |
430 ASSERT(value); | 430 ASSERT(value); |
431 beforeSlash->append(value); | 431 beforeSlash->append(value); |
432 } | 432 } |
433 beforeSlash->append(currLayer->image() ? currLayer->image()->cssValue()
: cssValuePool().createIdentifierValue(CSSValueNone)); | 433 beforeSlash->append(currLayer->image() ? currLayer->image()->cssValue()
: cssValuePool().createIdentifierValue(CSSValueNone)); |
434 beforeSlash->append(valueForFillRepeat(currLayer->repeatX(), currLayer->
repeatY())); | 434 beforeSlash->append(valueForFillRepeat(currLayer->repeatX(), currLayer->
repeatY())); |
435 beforeSlash->append(cssValuePool().createValue(currLayer->attachment()))
; | 435 beforeSlash->append(cssValuePool().createValue(currLayer->attachment()))
; |
436 beforeSlash->append(createPositionListForLayer(CSSPropertyBackgroundPosi
tion, *currLayer, style)); | 436 beforeSlash->append(createPositionListForLayer(CSSPropertyBackgroundPosi
tion, *currLayer, style)); |
437 list->append(beforeSlash); | 437 list->append(beforeSlash); |
438 RefPtrWillBeRawPtr<CSSValueList> afterSlash = CSSValueList::createSpaceS
eparated(); | 438 RefPtrWillBeRawPtr<CSSValueList> afterSlash = CSSValueList::createSpaceS
eparated(); |
439 afterSlash->append(valueForFillSize(currLayer->size(), style)); | 439 afterSlash->append(valueForFillSize(currLayer->size(), style)); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); | 572 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); |
573 if (namedGridLines.isEmpty()) | 573 if (namedGridLines.isEmpty()) |
574 return; | 574 return; |
575 | 575 |
576 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue:
:create(); | 576 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue:
:create(); |
577 for (size_t j = 0; j < namedGridLines.size(); ++j) | 577 for (size_t j = 0; j < namedGridLines.size(); ++j) |
578 lineNames->append(cssValuePool().createValue(namedGridLines[j], CSSPrimi
tiveValue::CSS_CUSTOM_IDENT)); | 578 lineNames->append(cssValuePool().createValue(namedGridLines[j], CSSPrimi
tiveValue::CSS_CUSTOM_IDENT)); |
579 list.append(lineNames.release()); | 579 list.append(lineNames.release()); |
580 } | 580 } |
581 | 581 |
582 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDir
ection direction, const LayoutObject* renderer, const ComputedStyle& style) | 582 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDir
ection direction, const LayoutObject* layoutObject, const ComputedStyle& style) |
583 { | 583 { |
584 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr
idTemplateColumns() : style.gridTemplateRows(); | 584 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr
idTemplateColumns() : style.gridTemplateRows(); |
585 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns
? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines(); | 585 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns
? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines(); |
586 bool isLayoutGrid = renderer && renderer->isLayoutGrid(); | 586 bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid(); |
587 | 587 |
588 // Handle the 'none' case. | 588 // Handle the 'none' case. |
589 bool trackListIsEmpty = trackSizes.isEmpty(); | 589 bool trackListIsEmpty = trackSizes.isEmpty(); |
590 if (isLayoutGrid && trackListIsEmpty) { | 590 if (isLayoutGrid && trackListIsEmpty) { |
591 // For grids we should consider every listed track, whether implicitly o
r explicitly created. If we don't have | 591 // For grids we should consider every listed track, whether implicitly o
r explicitly created. If we don't have |
592 // any explicit track and there are no children then there are no implic
it tracks. We cannot simply check the | 592 // any explicit track and there are no children then there are no implic
it tracks. We cannot simply check the |
593 // number of rows/columns in our internal grid representation because it
's always at least 1x1 (see r143331). | 593 // number of rows/columns in our internal grid representation because it
's always at least 1x1 (see r143331). |
594 trackListIsEmpty = !toLayoutBlock(renderer)->firstChild(); | 594 trackListIsEmpty = !toLayoutBlock(layoutObject)->firstChild(); |
595 } | 595 } |
596 | 596 |
597 if (trackListIsEmpty) { | 597 if (trackListIsEmpty) { |
598 ASSERT(orderedNamedGridLines.isEmpty()); | 598 ASSERT(orderedNamedGridLines.isEmpty()); |
599 return cssValuePool().createIdentifierValue(CSSValueNone); | 599 return cssValuePool().createIdentifierValue(CSSValueNone); |
600 } | 600 } |
601 | 601 |
602 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 602 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
603 if (isLayoutGrid) { | 603 if (isLayoutGrid) { |
604 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? toL
ayoutGrid(renderer)->columnPositions() : toLayoutGrid(renderer)->rowPositions(); | 604 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? toL
ayoutGrid(layoutObject)->columnPositions() : toLayoutGrid(layoutObject)->rowPosi
tions(); |
605 // There are at least #tracks + 1 grid lines (trackPositions). Apart fro
m that, the grid container can generate implicit grid tracks, | 605 // There are at least #tracks + 1 grid lines (trackPositions). Apart fro
m that, the grid container can generate implicit grid tracks, |
606 // so we'll have more trackPositions than trackSizes as the latter only
contain the explicit grid. | 606 // so we'll have more trackPositions than trackSizes as the latter only
contain the explicit grid. |
607 ASSERT(trackPositions.size() - 1 >= trackSizes.size()); | 607 ASSERT(trackPositions.size() - 1 >= trackSizes.size()); |
608 | 608 |
609 for (size_t i = 0; i < trackPositions.size() - 1; ++i) { | 609 for (size_t i = 0; i < trackPositions.size() - 1; ++i) { |
610 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); | 610 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); |
611 list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPos
itions[i], style)); | 611 list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPos
itions[i], style)); |
612 } | 612 } |
613 } else { | 613 } else { |
614 for (size_t i = 0; i < trackSizes.size(); ++i) { | 614 for (size_t i = 0; i < trackSizes.size(); ++i) { |
(...skipping 20 matching lines...) Expand all Loading... |
635 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::CSS_NUMBER)); | 635 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::CSS_NUMBER)); |
636 } else { | 636 } else { |
637 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::CSS_NUMBER)); | 637 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::CSS_NUMBER)); |
638 } | 638 } |
639 | 639 |
640 if (!position.namedGridLine().isNull()) | 640 if (!position.namedGridLine().isNull()) |
641 list->append(cssValuePool().createValue(position.namedGridLine(), CSSPri
mitiveValue::CSS_CUSTOM_IDENT)); | 641 list->append(cssValuePool().createValue(position.namedGridLine(), CSSPri
mitiveValue::CSS_CUSTOM_IDENT)); |
642 return list; | 642 return list; |
643 } | 643 } |
644 | 644 |
645 static LayoutRect sizingBox(const LayoutObject* renderer) | 645 static LayoutRect sizingBox(const LayoutObject* layoutObject) |
646 { | 646 { |
647 if (!renderer->isBox()) | 647 if (!layoutObject->isBox()) |
648 return LayoutRect(); | 648 return LayoutRect(); |
649 | 649 |
650 const LayoutBox* box = toLayoutBox(renderer); | 650 const LayoutBox* box = toLayoutBox(layoutObject); |
651 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box-
>computedCSSContentBoxRect(); | 651 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box-
>computedCSSContentBoxRect(); |
652 } | 652 } |
653 | 653 |
654 static PassRefPtrWillBeRawPtr<CSSValue> scrollBlocksOnFlagsToCSSValue(WebScrollB
locksOn scrollBlocksOn) | 654 static PassRefPtrWillBeRawPtr<CSSValue> scrollBlocksOnFlagsToCSSValue(WebScrollB
locksOn scrollBlocksOn) |
655 { | 655 { |
656 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 656 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
657 | 657 |
658 if (scrollBlocksOn == WebScrollBlocksOnNone) | 658 if (scrollBlocksOn == WebScrollBlocksOnNone) |
659 return cssValuePool().createIdentifierValue(CSSValueNone); | 659 return cssValuePool().createIdentifierValue(CSSValueNone); |
660 | 660 |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 | 925 |
926 transformValue->append(zoomAdjustedNumberValue(transform.m41(), style)); | 926 transformValue->append(zoomAdjustedNumberValue(transform.m41(), style)); |
927 transformValue->append(zoomAdjustedNumberValue(transform.m42(), style)); | 927 transformValue->append(zoomAdjustedNumberValue(transform.m42(), style)); |
928 transformValue->append(zoomAdjustedNumberValue(transform.m43(), style)); | 928 transformValue->append(zoomAdjustedNumberValue(transform.m43(), style)); |
929 transformValue->append(cssValuePool().createValue(transform.m44(), CSSPr
imitiveValue::CSS_NUMBER)); | 929 transformValue->append(cssValuePool().createValue(transform.m44(), CSSPr
imitiveValue::CSS_NUMBER)); |
930 } | 930 } |
931 | 931 |
932 return transformValue.release(); | 932 return transformValue.release(); |
933 } | 933 } |
934 | 934 |
935 static PassRefPtrWillBeRawPtr<CSSValue> computedTransform(const LayoutObject* re
nderer, const ComputedStyle& style) | 935 static PassRefPtrWillBeRawPtr<CSSValue> computedTransform(const LayoutObject* la
youtObject, const ComputedStyle& style) |
936 { | 936 { |
937 if (!renderer || !renderer->hasTransformRelatedProperty() || !style.hasTrans
form()) | 937 if (!layoutObject || !layoutObject->hasTransformRelatedProperty() || !style.
hasTransform()) |
938 return cssValuePool().createIdentifierValue(CSSValueNone); | 938 return cssValuePool().createIdentifierValue(CSSValueNone); |
939 | 939 |
940 IntRect box; | 940 IntRect box; |
941 if (renderer->isBox()) | 941 if (layoutObject->isBox()) |
942 box = pixelSnappedIntRect(toLayoutBox(renderer)->borderBoxRect()); | 942 box = pixelSnappedIntRect(toLayoutBox(layoutObject)->borderBoxRect()); |
943 | 943 |
944 TransformationMatrix transform; | 944 TransformationMatrix transform; |
945 style.applyTransform(transform, LayoutSize(box.size()), ComputedStyle::Exclu
deTransformOrigin, ComputedStyle::ExcludeMotionPath); | 945 style.applyTransform(transform, LayoutSize(box.size()), ComputedStyle::Exclu
deTransformOrigin, ComputedStyle::ExcludeMotionPath); |
946 | 946 |
947 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh
ow_bug.cgi?id=23924) | 947 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh
ow_bug.cgi?id=23924) |
948 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 948 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
949 list->append(valueForMatrixTransform(transform, style)); | 949 list->append(valueForMatrixTransform(transform, style)); |
950 | 950 |
951 return list.release(); | 951 return list.release(); |
952 } | 952 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 | 1038 |
1039 ASSERT(shapeValue->type() == ShapeValue::Shape); | 1039 ASSERT(shapeValue->type() == ShapeValue::Shape); |
1040 | 1040 |
1041 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1041 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
1042 list->append(valueForBasicShape(style, shapeValue->shape())); | 1042 list->append(valueForBasicShape(style, shapeValue->shape())); |
1043 if (shapeValue->cssBox() != BoxMissing) | 1043 if (shapeValue->cssBox() != BoxMissing) |
1044 list->append(cssValuePool().createValue(shapeValue->cssBox())); | 1044 list->append(cssValuePool().createValue(shapeValue->cssBox())); |
1045 return list.release(); | 1045 return list.release(); |
1046 } | 1046 } |
1047 | 1047 |
1048 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForSidesShorthand(const StyleP
ropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* ren
derer, Node* styledNode, bool allowVisitedStyle) | 1048 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForSidesShorthand(const StyleP
ropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* lay
outObject, Node* styledNode, bool allowVisitedStyle) |
1049 { | 1049 { |
1050 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1050 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
1051 // Assume the properties are in the usual order top, right, bottom, left. | 1051 // Assume the properties are in the usual order top, right, bottom, left. |
1052 RefPtrWillBeRawPtr<CSSValue> topValue = ComputedStyleCSSValueMapping::get(sh
orthand.properties()[0], style, renderer, styledNode, allowVisitedStyle); | 1052 RefPtrWillBeRawPtr<CSSValue> topValue = ComputedStyleCSSValueMapping::get(sh
orthand.properties()[0], style, layoutObject, styledNode, allowVisitedStyle); |
1053 RefPtrWillBeRawPtr<CSSValue> rightValue = ComputedStyleCSSValueMapping::get(
shorthand.properties()[1], style, renderer, styledNode, allowVisitedStyle); | 1053 RefPtrWillBeRawPtr<CSSValue> rightValue = ComputedStyleCSSValueMapping::get(
shorthand.properties()[1], style, layoutObject, styledNode, allowVisitedStyle); |
1054 RefPtrWillBeRawPtr<CSSValue> bottomValue = ComputedStyleCSSValueMapping::get
(shorthand.properties()[2], style, renderer, styledNode, allowVisitedStyle); | 1054 RefPtrWillBeRawPtr<CSSValue> bottomValue = ComputedStyleCSSValueMapping::get
(shorthand.properties()[2], style, layoutObject, styledNode, allowVisitedStyle); |
1055 RefPtrWillBeRawPtr<CSSValue> leftValue = ComputedStyleCSSValueMapping::get(s
horthand.properties()[3], style, renderer, styledNode, allowVisitedStyle); | 1055 RefPtrWillBeRawPtr<CSSValue> leftValue = ComputedStyleCSSValueMapping::get(s
horthand.properties()[3], style, layoutObject, styledNode, allowVisitedStyle); |
1056 | 1056 |
1057 // All 4 properties must be specified. | 1057 // All 4 properties must be specified. |
1058 if (!topValue || !rightValue || !bottomValue || !leftValue) | 1058 if (!topValue || !rightValue || !bottomValue || !leftValue) |
1059 return nullptr; | 1059 return nullptr; |
1060 | 1060 |
1061 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); | 1061 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); |
1062 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; | 1062 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; |
1063 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; | 1063 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; |
1064 | 1064 |
1065 list->append(topValue.release()); | 1065 list->append(topValue.release()); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 default: | 1277 default: |
1278 ASSERT_NOT_REACHED(); | 1278 ASSERT_NOT_REACHED(); |
1279 break; | 1279 break; |
1280 } | 1280 } |
1281 list->append(filterValue.release()); | 1281 list->append(filterValue.release()); |
1282 } | 1282 } |
1283 | 1283 |
1284 return list.release(); | 1284 return list.release(); |
1285 } | 1285 } |
1286 | 1286 |
1287 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
propertyID, const ComputedStyle& style, const LayoutObject* renderer, Node* sty
ledNode, bool allowVisitedStyle) | 1287 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
propertyID, const ComputedStyle& style, const LayoutObject* layoutObject, Node*
styledNode, bool allowVisitedStyle) |
1288 { | 1288 { |
1289 const SVGComputedStyle& svgStyle = style.svgStyle(); | 1289 const SVGComputedStyle& svgStyle = style.svgStyle(); |
1290 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di
rection(), style.writingMode()); | 1290 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di
rection(), style.writingMode()); |
1291 switch (propertyID) { | 1291 switch (propertyID) { |
1292 case CSSPropertyInvalid: | 1292 case CSSPropertyInvalid: |
1293 return nullptr; | 1293 return nullptr; |
1294 | 1294 |
1295 case CSSPropertyBackgroundColor: | 1295 case CSSPropertyBackgroundColor: |
1296 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited
DependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(sty
le, style.backgroundColor()); | 1296 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited
DependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(sty
le, style.backgroundColor()); |
1297 case CSSPropertyBackgroundImage: | 1297 case CSSPropertyBackgroundImage: |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 return cssValuePool().createValue(style.borderLeftStyle()); | 1417 return cssValuePool().createValue(style.borderLeftStyle()); |
1418 case CSSPropertyBorderTopWidth: | 1418 case CSSPropertyBorderTopWidth: |
1419 return zoomAdjustedPixelValue(style.borderTopWidth(), style); | 1419 return zoomAdjustedPixelValue(style.borderTopWidth(), style); |
1420 case CSSPropertyBorderRightWidth: | 1420 case CSSPropertyBorderRightWidth: |
1421 return zoomAdjustedPixelValue(style.borderRightWidth(), style); | 1421 return zoomAdjustedPixelValue(style.borderRightWidth(), style); |
1422 case CSSPropertyBorderBottomWidth: | 1422 case CSSPropertyBorderBottomWidth: |
1423 return zoomAdjustedPixelValue(style.borderBottomWidth(), style); | 1423 return zoomAdjustedPixelValue(style.borderBottomWidth(), style); |
1424 case CSSPropertyBorderLeftWidth: | 1424 case CSSPropertyBorderLeftWidth: |
1425 return zoomAdjustedPixelValue(style.borderLeftWidth(), style); | 1425 return zoomAdjustedPixelValue(style.borderLeftWidth(), style); |
1426 case CSSPropertyBottom: | 1426 case CSSPropertyBottom: |
1427 return valueForPositionOffset(style, CSSPropertyBottom, renderer); | 1427 return valueForPositionOffset(style, CSSPropertyBottom, layoutObject); |
1428 case CSSPropertyWebkitBoxAlign: | 1428 case CSSPropertyWebkitBoxAlign: |
1429 return cssValuePool().createValue(style.boxAlign()); | 1429 return cssValuePool().createValue(style.boxAlign()); |
1430 case CSSPropertyWebkitBoxDecorationBreak: | 1430 case CSSPropertyWebkitBoxDecorationBreak: |
1431 if (style.boxDecorationBreak() == DSLICE) | 1431 if (style.boxDecorationBreak() == DSLICE) |
1432 return cssValuePool().createIdentifierValue(CSSValueSlice); | 1432 return cssValuePool().createIdentifierValue(CSSValueSlice); |
1433 return cssValuePool().createIdentifierValue(CSSValueClone); | 1433 return cssValuePool().createIdentifierValue(CSSValueClone); |
1434 case CSSPropertyWebkitBoxDirection: | 1434 case CSSPropertyWebkitBoxDirection: |
1435 return cssValuePool().createValue(style.boxDirection()); | 1435 return cssValuePool().createValue(style.boxDirection()); |
1436 case CSSPropertyWebkitBoxFlex: | 1436 case CSSPropertyWebkitBoxFlex: |
1437 return cssValuePool().createValue(style.boxFlex(), CSSPrimitiveValue::CS
S_NUMBER); | 1437 return cssValuePool().createValue(style.boxFlex(), CSSPrimitiveValue::CS
S_NUMBER); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 return cssValuePool().createValue(style.display()); | 1512 return cssValuePool().createValue(style.display()); |
1513 case CSSPropertyEmptyCells: | 1513 case CSSPropertyEmptyCells: |
1514 return cssValuePool().createValue(style.emptyCells()); | 1514 return cssValuePool().createValue(style.emptyCells()); |
1515 case CSSPropertyAlignContent: | 1515 case CSSPropertyAlignContent: |
1516 return valueForContentPositionAndDistributionWithOverflowAlignment(resol
veContentAlignmentAuto(style.alignContentPosition(), style.alignContentDistribut
ion(), styledNode), style.alignContentOverflowAlignment(), style.alignContentDis
tribution()); | 1516 return valueForContentPositionAndDistributionWithOverflowAlignment(resol
veContentAlignmentAuto(style.alignContentPosition(), style.alignContentDistribut
ion(), styledNode), style.alignContentOverflowAlignment(), style.alignContentDis
tribution()); |
1517 case CSSPropertyAlignItems: | 1517 case CSSPropertyAlignItems: |
1518 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.alignItemsPosition(), styledNode), style.alignItemsOverflowAlignment(), NonL
egacyPosition); | 1518 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.alignItemsPosition(), styledNode), style.alignItemsOverflowAlignment(), NonL
egacyPosition); |
1519 case CSSPropertyAlignSelf: | 1519 case CSSPropertyAlignSelf: |
1520 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.alignSelfPosition(), styledNode->parentNode()), style.alignSelfOverflowAlign
ment(), NonLegacyPosition); | 1520 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.alignSelfPosition(), styledNode->parentNode()), style.alignSelfOverflowAlign
ment(), NonLegacyPosition); |
1521 case CSSPropertyFlex: | 1521 case CSSPropertyFlex: |
1522 return valuesForShorthandProperty(flexShorthand(), style, renderer, styl
edNode, allowVisitedStyle); | 1522 return valuesForShorthandProperty(flexShorthand(), style, layoutObject,
styledNode, allowVisitedStyle); |
1523 case CSSPropertyFlexBasis: | 1523 case CSSPropertyFlexBasis: |
1524 return zoomAdjustedPixelValueForLength(style.flexBasis(), style); | 1524 return zoomAdjustedPixelValueForLength(style.flexBasis(), style); |
1525 case CSSPropertyFlexDirection: | 1525 case CSSPropertyFlexDirection: |
1526 return cssValuePool().createValue(style.flexDirection()); | 1526 return cssValuePool().createValue(style.flexDirection()); |
1527 case CSSPropertyFlexFlow: | 1527 case CSSPropertyFlexFlow: |
1528 return valuesForShorthandProperty(flexFlowShorthand(), style, renderer,
styledNode, allowVisitedStyle); | 1528 return valuesForShorthandProperty(flexFlowShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); |
1529 case CSSPropertyFlexGrow: | 1529 case CSSPropertyFlexGrow: |
1530 return cssValuePool().createValue(style.flexGrow()); | 1530 return cssValuePool().createValue(style.flexGrow()); |
1531 case CSSPropertyFlexShrink: | 1531 case CSSPropertyFlexShrink: |
1532 return cssValuePool().createValue(style.flexShrink()); | 1532 return cssValuePool().createValue(style.flexShrink()); |
1533 case CSSPropertyFlexWrap: | 1533 case CSSPropertyFlexWrap: |
1534 return cssValuePool().createValue(style.flexWrap()); | 1534 return cssValuePool().createValue(style.flexWrap()); |
1535 case CSSPropertyJustifyContent: | 1535 case CSSPropertyJustifyContent: |
1536 return valueForContentPositionAndDistributionWithOverflowAlignment(resol
veContentAlignmentAuto(style.justifyContentPosition(), style.justifyContentDistr
ibution(), styledNode), style.justifyContentOverflowAlignment(), style.justifyCo
ntentDistribution()); | 1536 return valueForContentPositionAndDistributionWithOverflowAlignment(resol
veContentAlignmentAuto(style.justifyContentPosition(), style.justifyContentDistr
ibution(), styledNode), style.justifyContentOverflowAlignment(), style.justifyCo
ntentDistribution()); |
1537 case CSSPropertyOrder: | 1537 case CSSPropertyOrder: |
1538 return cssValuePool().createValue(style.order(), CSSPrimitiveValue::CSS_
NUMBER); | 1538 return cssValuePool().createValue(style.order(), CSSPrimitiveValue::CSS_
NUMBER); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1610 // one for grid-definition-{rows|columns} but not for the grid-auto-{rows|co
lumns} as things like | 1610 // one for grid-definition-{rows|columns} but not for the grid-auto-{rows|co
lumns} as things like |
1611 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as the '2
fr' means very different things | 1611 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as the '2
fr' means very different things |
1612 // depending on the size of the explicit grid or the number of implicit trac
ks added to the grid. See | 1612 // depending on the size of the explicit grid or the number of implicit trac
ks added to the grid. See |
1613 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html | 1613 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html |
1614 case CSSPropertyGridAutoColumns: | 1614 case CSSPropertyGridAutoColumns: |
1615 return specifiedValueForGridTrackSize(style.gridAutoColumns(), style); | 1615 return specifiedValueForGridTrackSize(style.gridAutoColumns(), style); |
1616 case CSSPropertyGridAutoRows: | 1616 case CSSPropertyGridAutoRows: |
1617 return specifiedValueForGridTrackSize(style.gridAutoRows(), style); | 1617 return specifiedValueForGridTrackSize(style.gridAutoRows(), style); |
1618 | 1618 |
1619 case CSSPropertyGridTemplateColumns: | 1619 case CSSPropertyGridTemplateColumns: |
1620 return valueForGridTrackList(ForColumns, renderer, style); | 1620 return valueForGridTrackList(ForColumns, layoutObject, style); |
1621 case CSSPropertyGridTemplateRows: | 1621 case CSSPropertyGridTemplateRows: |
1622 return valueForGridTrackList(ForRows, renderer, style); | 1622 return valueForGridTrackList(ForRows, layoutObject, style); |
1623 | 1623 |
1624 case CSSPropertyGridColumnStart: | 1624 case CSSPropertyGridColumnStart: |
1625 return valueForGridPosition(style.gridColumnStart()); | 1625 return valueForGridPosition(style.gridColumnStart()); |
1626 case CSSPropertyGridColumnEnd: | 1626 case CSSPropertyGridColumnEnd: |
1627 return valueForGridPosition(style.gridColumnEnd()); | 1627 return valueForGridPosition(style.gridColumnEnd()); |
1628 case CSSPropertyGridRowStart: | 1628 case CSSPropertyGridRowStart: |
1629 return valueForGridPosition(style.gridRowStart()); | 1629 return valueForGridPosition(style.gridRowStart()); |
1630 case CSSPropertyGridRowEnd: | 1630 case CSSPropertyGridRowEnd: |
1631 return valueForGridPosition(style.gridRowEnd()); | 1631 return valueForGridPosition(style.gridRowEnd()); |
1632 case CSSPropertyGridColumn: | 1632 case CSSPropertyGridColumn: |
1633 return valuesForGridShorthand(gridColumnShorthand(), style, renderer, st
yledNode, allowVisitedStyle); | 1633 return valuesForGridShorthand(gridColumnShorthand(), style, layoutObject
, styledNode, allowVisitedStyle); |
1634 case CSSPropertyGridRow: | 1634 case CSSPropertyGridRow: |
1635 return valuesForGridShorthand(gridRowShorthand(), style, renderer, style
dNode, allowVisitedStyle); | 1635 return valuesForGridShorthand(gridRowShorthand(), style, layoutObject, s
tyledNode, allowVisitedStyle); |
1636 case CSSPropertyGridArea: | 1636 case CSSPropertyGridArea: |
1637 return valuesForGridShorthand(gridAreaShorthand(), style, renderer, styl
edNode, allowVisitedStyle); | 1637 return valuesForGridShorthand(gridAreaShorthand(), style, layoutObject,
styledNode, allowVisitedStyle); |
1638 case CSSPropertyGridTemplate: | 1638 case CSSPropertyGridTemplate: |
1639 return valuesForGridShorthand(gridTemplateShorthand(), style, renderer,
styledNode, allowVisitedStyle); | 1639 return valuesForGridShorthand(gridTemplateShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); |
1640 case CSSPropertyGrid: | 1640 case CSSPropertyGrid: |
1641 return valuesForGridShorthand(gridShorthand(), style, renderer, styledNo
de, allowVisitedStyle); | 1641 return valuesForGridShorthand(gridShorthand(), style, layoutObject, styl
edNode, allowVisitedStyle); |
1642 case CSSPropertyGridTemplateAreas: | 1642 case CSSPropertyGridTemplateAreas: |
1643 if (!style.namedGridAreaRowCount()) { | 1643 if (!style.namedGridAreaRowCount()) { |
1644 ASSERT(!style.namedGridAreaColumnCount()); | 1644 ASSERT(!style.namedGridAreaColumnCount()); |
1645 return cssValuePool().createIdentifierValue(CSSValueNone); | 1645 return cssValuePool().createIdentifierValue(CSSValueNone); |
1646 } | 1646 } |
1647 | 1647 |
1648 return CSSGridTemplateAreasValue::create(style.namedGridArea(), style.na
medGridAreaRowCount(), style.namedGridAreaColumnCount()); | 1648 return CSSGridTemplateAreasValue::create(style.namedGridArea(), style.na
medGridAreaRowCount(), style.namedGridAreaColumnCount()); |
1649 | 1649 |
1650 case CSSPropertyHeight: | 1650 case CSSPropertyHeight: |
1651 if (renderer) { | 1651 if (layoutObject) { |
1652 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr
operty, | 1652 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr
operty, |
1653 // the "height" property does not apply for non-replaced inline elem
ents. | 1653 // the "height" property does not apply for non-replaced inline elem
ents. |
1654 if (!renderer->isReplaced() && renderer->isInline()) | 1654 if (!layoutObject->isReplaced() && layoutObject->isInline()) |
1655 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1655 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1656 return zoomAdjustedPixelValue(sizingBox(renderer).height(), style); | 1656 return zoomAdjustedPixelValue(sizingBox(layoutObject).height(), styl
e); |
1657 } | 1657 } |
1658 return zoomAdjustedPixelValueForLength(style.height(), style); | 1658 return zoomAdjustedPixelValueForLength(style.height(), style); |
1659 case CSSPropertyWebkitHighlight: | 1659 case CSSPropertyWebkitHighlight: |
1660 if (style.highlight() == nullAtom) | 1660 if (style.highlight() == nullAtom) |
1661 return cssValuePool().createIdentifierValue(CSSValueNone); | 1661 return cssValuePool().createIdentifierValue(CSSValueNone); |
1662 return cssValuePool().createValue(style.highlight(), CSSPrimitiveValue::
CSS_STRING); | 1662 return cssValuePool().createValue(style.highlight(), CSSPrimitiveValue::
CSS_STRING); |
1663 case CSSPropertyWebkitHyphenateCharacter: | 1663 case CSSPropertyWebkitHyphenateCharacter: |
1664 if (style.hyphenationString().isNull()) | 1664 if (style.hyphenationString().isNull()) |
1665 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1665 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1666 return cssValuePool().createValue(style.hyphenationString(), CSSPrimitiv
eValue::CSS_STRING); | 1666 return cssValuePool().createValue(style.hyphenationString(), CSSPrimitiv
eValue::CSS_STRING); |
1667 case CSSPropertyImageRendering: | 1667 case CSSPropertyImageRendering: |
1668 return CSSPrimitiveValue::create(style.imageRendering()); | 1668 return CSSPrimitiveValue::create(style.imageRendering()); |
1669 case CSSPropertyIsolation: | 1669 case CSSPropertyIsolation: |
1670 return cssValuePool().createValue(style.isolation()); | 1670 return cssValuePool().createValue(style.isolation()); |
1671 case CSSPropertyJustifyItems: | 1671 case CSSPropertyJustifyItems: |
1672 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifyItemsPosition(), styledNode), style.justifyItemsOverflowAlignment(),
style.justifyItemsPositionType()); | 1672 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifyItemsPosition(), styledNode), style.justifyItemsOverflowAlignment(),
style.justifyItemsPositionType()); |
1673 case CSSPropertyJustifySelf: | 1673 case CSSPropertyJustifySelf: |
1674 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifySelfPosition(), styledNode->parentNode()), style.justifySelfOverflowA
lignment(), NonLegacyPosition); | 1674 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifySelfPosition(), styledNode->parentNode()), style.justifySelfOverflowA
lignment(), NonLegacyPosition); |
1675 case CSSPropertyLeft: | 1675 case CSSPropertyLeft: |
1676 return valueForPositionOffset(style, CSSPropertyLeft, renderer); | 1676 return valueForPositionOffset(style, CSSPropertyLeft, layoutObject); |
1677 case CSSPropertyLetterSpacing: | 1677 case CSSPropertyLetterSpacing: |
1678 if (!style.letterSpacing()) | 1678 if (!style.letterSpacing()) |
1679 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1679 return cssValuePool().createIdentifierValue(CSSValueNormal); |
1680 return zoomAdjustedPixelValue(style.letterSpacing(), style); | 1680 return zoomAdjustedPixelValue(style.letterSpacing(), style); |
1681 case CSSPropertyWebkitLineClamp: | 1681 case CSSPropertyWebkitLineClamp: |
1682 if (style.lineClamp().isNone()) | 1682 if (style.lineClamp().isNone()) |
1683 return cssValuePool().createIdentifierValue(CSSValueNone); | 1683 return cssValuePool().createIdentifierValue(CSSValueNone); |
1684 return cssValuePool().createValue(style.lineClamp().value(), style.lineC
lamp().isPercentage() ? CSSPrimitiveValue::CSS_PERCENTAGE : CSSPrimitiveValue::C
SS_NUMBER); | 1684 return cssValuePool().createValue(style.lineClamp().value(), style.lineC
lamp().isPercentage() ? CSSPrimitiveValue::CSS_PERCENTAGE : CSSPrimitiveValue::C
SS_NUMBER); |
1685 case CSSPropertyLineHeight: | 1685 case CSSPropertyLineHeight: |
1686 return valueForLineHeight(style); | 1686 return valueForLineHeight(style); |
1687 case CSSPropertyListStyleImage: | 1687 case CSSPropertyListStyleImage: |
1688 if (style.listStyleImage()) | 1688 if (style.listStyleImage()) |
1689 return style.listStyleImage()->cssValue(); | 1689 return style.listStyleImage()->cssValue(); |
1690 return cssValuePool().createIdentifierValue(CSSValueNone); | 1690 return cssValuePool().createIdentifierValue(CSSValueNone); |
1691 case CSSPropertyListStylePosition: | 1691 case CSSPropertyListStylePosition: |
1692 return cssValuePool().createValue(style.listStylePosition()); | 1692 return cssValuePool().createValue(style.listStylePosition()); |
1693 case CSSPropertyListStyleType: | 1693 case CSSPropertyListStyleType: |
1694 return cssValuePool().createValue(style.listStyleType()); | 1694 return cssValuePool().createValue(style.listStyleType()); |
1695 case CSSPropertyWebkitLocale: | 1695 case CSSPropertyWebkitLocale: |
1696 if (style.locale().isNull()) | 1696 if (style.locale().isNull()) |
1697 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1697 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1698 return cssValuePool().createValue(style.locale(), CSSPrimitiveValue::CSS
_STRING); | 1698 return cssValuePool().createValue(style.locale(), CSSPrimitiveValue::CSS
_STRING); |
1699 case CSSPropertyMarginTop: { | 1699 case CSSPropertyMarginTop: { |
1700 Length marginTop = style.marginTop(); | 1700 Length marginTop = style.marginTop(); |
1701 if (marginTop.isFixed() || !renderer || !renderer->isBox()) | 1701 if (marginTop.isFixed() || !layoutObject || !layoutObject->isBox()) |
1702 return zoomAdjustedPixelValueForLength(marginTop, style); | 1702 return zoomAdjustedPixelValueForLength(marginTop, style); |
1703 return zoomAdjustedPixelValue(toLayoutBox(renderer)->marginTop(), style)
; | 1703 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), st
yle); |
1704 } | 1704 } |
1705 case CSSPropertyMarginRight: { | 1705 case CSSPropertyMarginRight: { |
1706 Length marginRight = style.marginRight(); | 1706 Length marginRight = style.marginRight(); |
1707 if (marginRight.isFixed() || !renderer || !renderer->isBox()) | 1707 if (marginRight.isFixed() || !layoutObject || !layoutObject->isBox()) |
1708 return zoomAdjustedPixelValueForLength(marginRight, style); | 1708 return zoomAdjustedPixelValueForLength(marginRight, style); |
1709 float value; | 1709 float value; |
1710 if (marginRight.isPercent()) { | 1710 if (marginRight.isPercent()) { |
1711 // LayoutBox gives a marginRight() that is the distance between the
right-edge of the child box | 1711 // LayoutBox gives a marginRight() that is the distance between the
right-edge of the child box |
1712 // and the right-edge of the containing box, when display == BLOCK.
Let's calculate the absolute | 1712 // and the right-edge of the containing box, when display == BLOCK.
Let's calculate the absolute |
1713 // value of the specified margin-right % instead of relying on Layou
tBox's marginRight() value. | 1713 // value of the specified margin-right % instead of relying on Layou
tBox's marginRight() value. |
1714 value = minimumValueForLength(marginRight, toLayoutBox(renderer)->co
ntainingBlockLogicalWidthForContent()).toFloat(); | 1714 value = minimumValueForLength(marginRight, toLayoutBox(layoutObject)
->containingBlockLogicalWidthForContent()).toFloat(); |
1715 } else { | 1715 } else { |
1716 value = toLayoutBox(renderer)->marginRight().toFloat(); | 1716 value = toLayoutBox(layoutObject)->marginRight().toFloat(); |
1717 } | 1717 } |
1718 return zoomAdjustedPixelValue(value, style); | 1718 return zoomAdjustedPixelValue(value, style); |
1719 } | 1719 } |
1720 case CSSPropertyMarginBottom: { | 1720 case CSSPropertyMarginBottom: { |
1721 Length marginBottom = style.marginBottom(); | 1721 Length marginBottom = style.marginBottom(); |
1722 if (marginBottom.isFixed() || !renderer || !renderer->isBox()) | 1722 if (marginBottom.isFixed() || !layoutObject || !layoutObject->isBox()) |
1723 return zoomAdjustedPixelValueForLength(marginBottom, style); | 1723 return zoomAdjustedPixelValueForLength(marginBottom, style); |
1724 return zoomAdjustedPixelValue(toLayoutBox(renderer)->marginBottom(), sty
le); | 1724 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginBottom(),
style); |
1725 } | 1725 } |
1726 case CSSPropertyMarginLeft: { | 1726 case CSSPropertyMarginLeft: { |
1727 Length marginLeft = style.marginLeft(); | 1727 Length marginLeft = style.marginLeft(); |
1728 if (marginLeft.isFixed() || !renderer || !renderer->isBox()) | 1728 if (marginLeft.isFixed() || !layoutObject || !layoutObject->isBox()) |
1729 return zoomAdjustedPixelValueForLength(marginLeft, style); | 1729 return zoomAdjustedPixelValueForLength(marginLeft, style); |
1730 return zoomAdjustedPixelValue(toLayoutBox(renderer)->marginLeft(), style
); | 1730 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginLeft(), s
tyle); |
1731 } | 1731 } |
1732 case CSSPropertyWebkitUserModify: | 1732 case CSSPropertyWebkitUserModify: |
1733 return cssValuePool().createValue(style.userModify()); | 1733 return cssValuePool().createValue(style.userModify()); |
1734 case CSSPropertyMaxHeight: { | 1734 case CSSPropertyMaxHeight: { |
1735 const Length& maxHeight = style.maxHeight(); | 1735 const Length& maxHeight = style.maxHeight(); |
1736 if (maxHeight.isMaxSizeNone()) | 1736 if (maxHeight.isMaxSizeNone()) |
1737 return cssValuePool().createIdentifierValue(CSSValueNone); | 1737 return cssValuePool().createIdentifierValue(CSSValueNone); |
1738 return zoomAdjustedPixelValueForLength(maxHeight, style); | 1738 return zoomAdjustedPixelValueForLength(maxHeight, style); |
1739 } | 1739 } |
1740 case CSSPropertyMaxWidth: { | 1740 case CSSPropertyMaxWidth: { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1780 case CSSPropertyOverflow: | 1780 case CSSPropertyOverflow: |
1781 return cssValuePool().createValue(max(style.overflowX(), style.overflowY
())); | 1781 return cssValuePool().createValue(max(style.overflowX(), style.overflowY
())); |
1782 case CSSPropertyOverflowWrap: | 1782 case CSSPropertyOverflowWrap: |
1783 return cssValuePool().createValue(style.overflowWrap()); | 1783 return cssValuePool().createValue(style.overflowWrap()); |
1784 case CSSPropertyOverflowX: | 1784 case CSSPropertyOverflowX: |
1785 return cssValuePool().createValue(style.overflowX()); | 1785 return cssValuePool().createValue(style.overflowX()); |
1786 case CSSPropertyOverflowY: | 1786 case CSSPropertyOverflowY: |
1787 return cssValuePool().createValue(style.overflowY()); | 1787 return cssValuePool().createValue(style.overflowY()); |
1788 case CSSPropertyPaddingTop: { | 1788 case CSSPropertyPaddingTop: { |
1789 Length paddingTop = style.paddingTop(); | 1789 Length paddingTop = style.paddingTop(); |
1790 if (paddingTop.isFixed() || !renderer || !renderer->isBox()) | 1790 if (paddingTop.isFixed() || !layoutObject || !layoutObject->isBox()) |
1791 return zoomAdjustedPixelValueForLength(paddingTop, style); | 1791 return zoomAdjustedPixelValueForLength(paddingTop, style); |
1792 return zoomAdjustedPixelValue(toLayoutBox(renderer)->computedCSSPaddingT
op(), style); | 1792 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd
ingTop(), style); |
1793 } | 1793 } |
1794 case CSSPropertyPaddingRight: { | 1794 case CSSPropertyPaddingRight: { |
1795 Length paddingRight = style.paddingRight(); | 1795 Length paddingRight = style.paddingRight(); |
1796 if (paddingRight.isFixed() || !renderer || !renderer->isBox()) | 1796 if (paddingRight.isFixed() || !layoutObject || !layoutObject->isBox()) |
1797 return zoomAdjustedPixelValueForLength(paddingRight, style); | 1797 return zoomAdjustedPixelValueForLength(paddingRight, style); |
1798 return zoomAdjustedPixelValue(toLayoutBox(renderer)->computedCSSPaddingR
ight(), style); | 1798 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd
ingRight(), style); |
1799 } | 1799 } |
1800 case CSSPropertyPaddingBottom: { | 1800 case CSSPropertyPaddingBottom: { |
1801 Length paddingBottom = style.paddingBottom(); | 1801 Length paddingBottom = style.paddingBottom(); |
1802 if (paddingBottom.isFixed() || !renderer || !renderer->isBox()) | 1802 if (paddingBottom.isFixed() || !layoutObject || !layoutObject->isBox()) |
1803 return zoomAdjustedPixelValueForLength(paddingBottom, style); | 1803 return zoomAdjustedPixelValueForLength(paddingBottom, style); |
1804 return zoomAdjustedPixelValue(toLayoutBox(renderer)->computedCSSPaddingB
ottom(), style); | 1804 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd
ingBottom(), style); |
1805 } | 1805 } |
1806 case CSSPropertyPaddingLeft: { | 1806 case CSSPropertyPaddingLeft: { |
1807 Length paddingLeft = style.paddingLeft(); | 1807 Length paddingLeft = style.paddingLeft(); |
1808 if (paddingLeft.isFixed() || !renderer || !renderer->isBox()) | 1808 if (paddingLeft.isFixed() || !layoutObject || !layoutObject->isBox()) |
1809 return zoomAdjustedPixelValueForLength(paddingLeft, style); | 1809 return zoomAdjustedPixelValueForLength(paddingLeft, style); |
1810 return zoomAdjustedPixelValue(toLayoutBox(renderer)->computedCSSPaddingL
eft(), style); | 1810 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd
ingLeft(), style); |
1811 } | 1811 } |
1812 case CSSPropertyPageBreakAfter: | 1812 case CSSPropertyPageBreakAfter: |
1813 return cssValuePool().createValue(style.pageBreakAfter()); | 1813 return cssValuePool().createValue(style.pageBreakAfter()); |
1814 case CSSPropertyPageBreakBefore: | 1814 case CSSPropertyPageBreakBefore: |
1815 return cssValuePool().createValue(style.pageBreakBefore()); | 1815 return cssValuePool().createValue(style.pageBreakBefore()); |
1816 case CSSPropertyPageBreakInside: { | 1816 case CSSPropertyPageBreakInside: { |
1817 EPageBreak pageBreak = style.pageBreakInside(); | 1817 EPageBreak pageBreak = style.pageBreakInside(); |
1818 ASSERT(pageBreak != PBALWAYS); | 1818 ASSERT(pageBreak != PBALWAYS); |
1819 if (pageBreak == PBALWAYS) | 1819 if (pageBreak == PBALWAYS) |
1820 return nullptr; | 1820 return nullptr; |
1821 return cssValuePool().createValue(style.pageBreakInside()); | 1821 return cssValuePool().createValue(style.pageBreakInside()); |
1822 } | 1822 } |
1823 case CSSPropertyPosition: | 1823 case CSSPropertyPosition: |
1824 return cssValuePool().createValue(style.position()); | 1824 return cssValuePool().createValue(style.position()); |
1825 case CSSPropertyRight: | 1825 case CSSPropertyRight: |
1826 return valueForPositionOffset(style, CSSPropertyRight, renderer); | 1826 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); |
1827 case CSSPropertyWebkitRubyPosition: | 1827 case CSSPropertyWebkitRubyPosition: |
1828 return cssValuePool().createValue(style.rubyPosition()); | 1828 return cssValuePool().createValue(style.rubyPosition()); |
1829 case CSSPropertyScrollBehavior: | 1829 case CSSPropertyScrollBehavior: |
1830 return cssValuePool().createValue(style.scrollBehavior()); | 1830 return cssValuePool().createValue(style.scrollBehavior()); |
1831 case CSSPropertyScrollBlocksOn: | 1831 case CSSPropertyScrollBlocksOn: |
1832 return scrollBlocksOnFlagsToCSSValue(style.scrollBlocksOn()); | 1832 return scrollBlocksOnFlagsToCSSValue(style.scrollBlocksOn()); |
1833 case CSSPropertyTableLayout: | 1833 case CSSPropertyTableLayout: |
1834 return cssValuePool().createValue(style.tableLayout()); | 1834 return cssValuePool().createValue(style.tableLayout()); |
1835 case CSSPropertyTextAlign: | 1835 case CSSPropertyTextAlign: |
1836 return cssValuePool().createValue(style.textAlign()); | 1836 return cssValuePool().createValue(style.textAlign()); |
1837 case CSSPropertyTextAlignLast: | 1837 case CSSPropertyTextAlignLast: |
1838 return cssValuePool().createValue(style.textAlignLast()); | 1838 return cssValuePool().createValue(style.textAlignLast()); |
1839 case CSSPropertyTextDecoration: | 1839 case CSSPropertyTextDecoration: |
1840 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()) | 1840 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()) |
1841 return valuesForShorthandProperty(textDecorationShorthand(), style,
renderer, styledNode, allowVisitedStyle); | 1841 return valuesForShorthandProperty(textDecorationShorthand(), style,
layoutObject, styledNode, allowVisitedStyle); |
1842 // Fall through. | 1842 // Fall through. |
1843 case CSSPropertyTextDecorationLine: | 1843 case CSSPropertyTextDecorationLine: |
1844 return renderTextDecorationFlagsToCSSValue(style.textDecoration()); | 1844 return renderTextDecorationFlagsToCSSValue(style.textDecoration()); |
1845 case CSSPropertyTextDecorationStyle: | 1845 case CSSPropertyTextDecorationStyle: |
1846 return valueForTextDecorationStyle(style.textDecorationStyle()); | 1846 return valueForTextDecorationStyle(style.textDecorationStyle()); |
1847 case CSSPropertyTextDecorationColor: | 1847 case CSSPropertyTextDecorationColor: |
1848 return currentColorOrValidColor(style, style.textDecorationColor()); | 1848 return currentColorOrValidColor(style, style.textDecorationColor()); |
1849 case CSSPropertyTextJustify: | 1849 case CSSPropertyTextJustify: |
1850 return cssValuePool().createValue(style.textJustify()); | 1850 return cssValuePool().createValue(style.textJustify()); |
1851 case CSSPropertyTextUnderlinePosition: | 1851 case CSSPropertyTextUnderlinePosition: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1899 return cssValuePool().createIdentifierValue(CSSValueClip); | 1899 return cssValuePool().createIdentifierValue(CSSValueClip); |
1900 case CSSPropertyWebkitTextSecurity: | 1900 case CSSPropertyWebkitTextSecurity: |
1901 return cssValuePool().createValue(style.textSecurity()); | 1901 return cssValuePool().createValue(style.textSecurity()); |
1902 case CSSPropertyWebkitTextStrokeColor: | 1902 case CSSPropertyWebkitTextStrokeColor: |
1903 return currentColorOrValidColor(style, style.textStrokeColor()); | 1903 return currentColorOrValidColor(style, style.textStrokeColor()); |
1904 case CSSPropertyWebkitTextStrokeWidth: | 1904 case CSSPropertyWebkitTextStrokeWidth: |
1905 return zoomAdjustedPixelValue(style.textStrokeWidth(), style); | 1905 return zoomAdjustedPixelValue(style.textStrokeWidth(), style); |
1906 case CSSPropertyTextTransform: | 1906 case CSSPropertyTextTransform: |
1907 return cssValuePool().createValue(style.textTransform()); | 1907 return cssValuePool().createValue(style.textTransform()); |
1908 case CSSPropertyTop: | 1908 case CSSPropertyTop: |
1909 return valueForPositionOffset(style, CSSPropertyTop, renderer); | 1909 return valueForPositionOffset(style, CSSPropertyTop, layoutObject); |
1910 case CSSPropertyTouchAction: | 1910 case CSSPropertyTouchAction: |
1911 return touchActionFlagsToCSSValue(style.touchAction()); | 1911 return touchActionFlagsToCSSValue(style.touchAction()); |
1912 case CSSPropertyUnicodeBidi: | 1912 case CSSPropertyUnicodeBidi: |
1913 return cssValuePool().createValue(style.unicodeBidi()); | 1913 return cssValuePool().createValue(style.unicodeBidi()); |
1914 case CSSPropertyVerticalAlign: | 1914 case CSSPropertyVerticalAlign: |
1915 switch (style.verticalAlign()) { | 1915 switch (style.verticalAlign()) { |
1916 case BASELINE: | 1916 case BASELINE: |
1917 return cssValuePool().createIdentifierValue(CSSValueBaseline); | 1917 return cssValuePool().createIdentifierValue(CSSValueBaseline); |
1918 case MIDDLE: | 1918 case MIDDLE: |
1919 return cssValuePool().createIdentifierValue(CSSValueMiddle); | 1919 return cssValuePool().createIdentifierValue(CSSValueMiddle); |
(...skipping 16 matching lines...) Expand all Loading... |
1936 } | 1936 } |
1937 ASSERT_NOT_REACHED(); | 1937 ASSERT_NOT_REACHED(); |
1938 return nullptr; | 1938 return nullptr; |
1939 case CSSPropertyVisibility: | 1939 case CSSPropertyVisibility: |
1940 return cssValuePool().createValue(style.visibility()); | 1940 return cssValuePool().createValue(style.visibility()); |
1941 case CSSPropertyWhiteSpace: | 1941 case CSSPropertyWhiteSpace: |
1942 return cssValuePool().createValue(style.whiteSpace()); | 1942 return cssValuePool().createValue(style.whiteSpace()); |
1943 case CSSPropertyWidows: | 1943 case CSSPropertyWidows: |
1944 return cssValuePool().createValue(style.widows(), CSSPrimitiveValue::CSS
_NUMBER); | 1944 return cssValuePool().createValue(style.widows(), CSSPrimitiveValue::CSS
_NUMBER); |
1945 case CSSPropertyWidth: | 1945 case CSSPropertyWidth: |
1946 if (renderer) { | 1946 if (layoutObject) { |
1947 // According to http://www.w3.org/TR/CSS2/visudet.html#the-width-pro
perty, | 1947 // According to http://www.w3.org/TR/CSS2/visudet.html#the-width-pro
perty, |
1948 // the "width" property does not apply for non-replaced inline eleme
nts. | 1948 // the "width" property does not apply for non-replaced inline eleme
nts. |
1949 if (!renderer->isReplaced() && renderer->isInline()) | 1949 if (!layoutObject->isReplaced() && layoutObject->isInline()) |
1950 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1950 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1951 return zoomAdjustedPixelValue(sizingBox(renderer).width(), style); | 1951 return zoomAdjustedPixelValue(sizingBox(layoutObject).width(), style
); |
1952 } | 1952 } |
1953 return zoomAdjustedPixelValueForLength(style.width(), style); | 1953 return zoomAdjustedPixelValueForLength(style.width(), style); |
1954 case CSSPropertyWillChange: | 1954 case CSSPropertyWillChange: |
1955 return valueForWillChange(style.willChangeProperties(), style.willChange
Contents(), style.willChangeScrollPosition()); | 1955 return valueForWillChange(style.willChangeProperties(), style.willChange
Contents(), style.willChangeScrollPosition()); |
1956 case CSSPropertyWordBreak: | 1956 case CSSPropertyWordBreak: |
1957 return cssValuePool().createValue(style.wordBreak()); | 1957 return cssValuePool().createValue(style.wordBreak()); |
1958 case CSSPropertyWordSpacing: | 1958 case CSSPropertyWordSpacing: |
1959 return zoomAdjustedPixelValue(style.wordSpacing(), style); | 1959 return zoomAdjustedPixelValue(style.wordSpacing(), style); |
1960 case CSSPropertyWordWrap: | 1960 case CSSPropertyWordWrap: |
1961 return cssValuePool().createValue(style.overflowWrap()); | 1961 return cssValuePool().createValue(style.overflowWrap()); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 return cssValuePool().createValue(style.marginAfterCollapse()); | 2128 return cssValuePool().createValue(style.marginAfterCollapse()); |
2129 case CSSPropertyWebkitMarginTopCollapse: | 2129 case CSSPropertyWebkitMarginTopCollapse: |
2130 case CSSPropertyWebkitMarginBeforeCollapse: | 2130 case CSSPropertyWebkitMarginBeforeCollapse: |
2131 return cssValuePool().createValue(style.marginBeforeCollapse()); | 2131 return cssValuePool().createValue(style.marginBeforeCollapse()); |
2132 case CSSPropertyPerspective: | 2132 case CSSPropertyPerspective: |
2133 if (!style.hasPerspective()) | 2133 if (!style.hasPerspective()) |
2134 return cssValuePool().createIdentifierValue(CSSValueNone); | 2134 return cssValuePool().createIdentifierValue(CSSValueNone); |
2135 return zoomAdjustedPixelValue(style.perspective(), style); | 2135 return zoomAdjustedPixelValue(style.perspective(), style); |
2136 case CSSPropertyPerspectiveOrigin: { | 2136 case CSSPropertyPerspectiveOrigin: { |
2137 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 2137 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); |
2138 if (renderer) { | 2138 if (layoutObject) { |
2139 LayoutRect box; | 2139 LayoutRect box; |
2140 if (renderer->isBox()) | 2140 if (layoutObject->isBox()) |
2141 box = toLayoutBox(renderer)->borderBoxRect(); | 2141 box = toLayoutBox(layoutObject)->borderBoxRect(); |
2142 | 2142 |
2143 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginX(), box.width()), style)); | 2143 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginX(), box.width()), style)); |
2144 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginY(), box.height()), style)); | 2144 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginY(), box.height()), style)); |
2145 } else { | 2145 } else { |
2146 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
X(), style)); | 2146 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
X(), style)); |
2147 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
Y(), style)); | 2147 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
Y(), style)); |
2148 } | 2148 } |
2149 return list.release(); | 2149 return list.release(); |
2150 } | 2150 } |
2151 case CSSPropertyWebkitRtlOrdering: | 2151 case CSSPropertyWebkitRtlOrdering: |
(...skipping 18 matching lines...) Expand all Loading... |
2170 RefPtrWillBeRawPtr<Rect> rect = Rect::create(); | 2170 RefPtrWillBeRawPtr<Rect> rect = Rect::create(); |
2171 rect->setTop(zoomAdjustedPixelValue(style.clip().top().value(), style)); | 2171 rect->setTop(zoomAdjustedPixelValue(style.clip().top().value(), style)); |
2172 rect->setRight(zoomAdjustedPixelValue(style.clip().right().value(), styl
e)); | 2172 rect->setRight(zoomAdjustedPixelValue(style.clip().right().value(), styl
e)); |
2173 rect->setBottom(zoomAdjustedPixelValue(style.clip().bottom().value(), st
yle)); | 2173 rect->setBottom(zoomAdjustedPixelValue(style.clip().bottom().value(), st
yle)); |
2174 rect->setLeft(zoomAdjustedPixelValue(style.clip().left().value(), style)
); | 2174 rect->setLeft(zoomAdjustedPixelValue(style.clip().left().value(), style)
); |
2175 return cssValuePool().createValue(rect.release()); | 2175 return cssValuePool().createValue(rect.release()); |
2176 } | 2176 } |
2177 case CSSPropertySpeak: | 2177 case CSSPropertySpeak: |
2178 return cssValuePool().createValue(style.speak()); | 2178 return cssValuePool().createValue(style.speak()); |
2179 case CSSPropertyTransform: | 2179 case CSSPropertyTransform: |
2180 return computedTransform(renderer, style); | 2180 return computedTransform(layoutObject, style); |
2181 case CSSPropertyTransformOrigin: { | 2181 case CSSPropertyTransformOrigin: { |
2182 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 2182 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); |
2183 if (renderer) { | 2183 if (layoutObject) { |
2184 LayoutRect box; | 2184 LayoutRect box; |
2185 if (renderer->isBox()) | 2185 if (layoutObject->isBox()) |
2186 box = toLayoutBox(renderer)->borderBoxRect(); | 2186 box = toLayoutBox(layoutObject)->borderBoxRect(); |
2187 | 2187 |
2188 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginX(), box.width()), style)); | 2188 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginX(), box.width()), style)); |
2189 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginY(), box.height()), style)); | 2189 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginY(), box.height()), style)); |
2190 if (style.transformOriginZ() != 0) | 2190 if (style.transformOriginZ() != 0) |
2191 list->append(zoomAdjustedPixelValue(style.transformOriginZ(), st
yle)); | 2191 list->append(zoomAdjustedPixelValue(style.transformOriginZ(), st
yle)); |
2192 } else { | 2192 } else { |
2193 list->append(zoomAdjustedPixelValueForLength(style.transformOriginX(
), style)); | 2193 list->append(zoomAdjustedPixelValueForLength(style.transformOriginX(
), style)); |
2194 list->append(zoomAdjustedPixelValueForLength(style.transformOriginY(
), style)); | 2194 list->append(zoomAdjustedPixelValueForLength(style.transformOriginY(
), style)); |
2195 if (style.transformOriginZ() != 0) | 2195 if (style.transformOriginZ() != 0) |
2196 list->append(zoomAdjustedPixelValue(style.transformOriginZ(), st
yle)); | 2196 list->append(zoomAdjustedPixelValue(style.transformOriginZ(), st
yle)); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2265 case CSSPropertyMixBlendMode: | 2265 case CSSPropertyMixBlendMode: |
2266 return cssValuePool().createValue(style.blendMode()); | 2266 return cssValuePool().createValue(style.blendMode()); |
2267 | 2267 |
2268 case CSSPropertyBackgroundBlendMode: { | 2268 case CSSPropertyBackgroundBlendMode: { |
2269 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2269 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); |
2270 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) | 2270 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) |
2271 list->append(cssValuePool().createValue(currLayer->blendMode())); | 2271 list->append(cssValuePool().createValue(currLayer->blendMode())); |
2272 return list.release(); | 2272 return list.release(); |
2273 } | 2273 } |
2274 case CSSPropertyBackground: | 2274 case CSSPropertyBackground: |
2275 return valuesForBackgroundShorthand(style, renderer, styledNode, allowVi
sitedStyle); | 2275 return valuesForBackgroundShorthand(style, layoutObject, styledNode, all
owVisitedStyle); |
2276 case CSSPropertyBorder: { | 2276 case CSSPropertyBorder: { |
2277 RefPtrWillBeRawPtr<CSSValue> value = get(CSSPropertyBorderTop, style, re
nderer, styledNode, allowVisitedStyle); | 2277 RefPtrWillBeRawPtr<CSSValue> value = get(CSSPropertyBorderTop, style, la
youtObject, styledNode, allowVisitedStyle); |
2278 const CSSPropertyID properties[] = { | 2278 const CSSPropertyID properties[] = { |
2279 CSSPropertyBorderRight, | 2279 CSSPropertyBorderRight, |
2280 CSSPropertyBorderBottom, | 2280 CSSPropertyBorderBottom, |
2281 CSSPropertyBorderLeft | 2281 CSSPropertyBorderLeft |
2282 }; | 2282 }; |
2283 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { | 2283 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { |
2284 if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, r
enderer, styledNode, allowVisitedStyle))) | 2284 if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, l
ayoutObject, styledNode, allowVisitedStyle))) |
2285 return nullptr; | 2285 return nullptr; |
2286 } | 2286 } |
2287 return value.release(); | 2287 return value.release(); |
2288 } | 2288 } |
2289 case CSSPropertyBorderBottom: | 2289 case CSSPropertyBorderBottom: |
2290 return valuesForShorthandProperty(borderBottomShorthand(), style, render
er, styledNode, allowVisitedStyle); | 2290 return valuesForShorthandProperty(borderBottomShorthand(), style, layout
Object, styledNode, allowVisitedStyle); |
2291 case CSSPropertyBorderColor: | 2291 case CSSPropertyBorderColor: |
2292 return valuesForSidesShorthand(borderColorShorthand(), style, renderer,
styledNode, allowVisitedStyle); | 2292 return valuesForSidesShorthand(borderColorShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); |
2293 case CSSPropertyBorderLeft: | 2293 case CSSPropertyBorderLeft: |
2294 return valuesForShorthandProperty(borderLeftShorthand(), style, renderer
, styledNode, allowVisitedStyle); | 2294 return valuesForShorthandProperty(borderLeftShorthand(), style, layoutOb
ject, styledNode, allowVisitedStyle); |
2295 case CSSPropertyBorderImage: | 2295 case CSSPropertyBorderImage: |
2296 return valueForNinePieceImage(style.borderImage(), style); | 2296 return valueForNinePieceImage(style.borderImage(), style); |
2297 case CSSPropertyBorderRadius: | 2297 case CSSPropertyBorderRadius: |
2298 return valueForBorderRadiusShorthand(style); | 2298 return valueForBorderRadiusShorthand(style); |
2299 case CSSPropertyBorderRight: | 2299 case CSSPropertyBorderRight: |
2300 return valuesForShorthandProperty(borderRightShorthand(), style, rendere
r, styledNode, allowVisitedStyle); | 2300 return valuesForShorthandProperty(borderRightShorthand(), style, layoutO
bject, styledNode, allowVisitedStyle); |
2301 case CSSPropertyBorderStyle: | 2301 case CSSPropertyBorderStyle: |
2302 return valuesForSidesShorthand(borderStyleShorthand(), style, renderer,
styledNode, allowVisitedStyle); | 2302 return valuesForSidesShorthand(borderStyleShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); |
2303 case CSSPropertyBorderTop: | 2303 case CSSPropertyBorderTop: |
2304 return valuesForShorthandProperty(borderTopShorthand(), style, renderer,
styledNode, allowVisitedStyle); | 2304 return valuesForShorthandProperty(borderTopShorthand(), style, layoutObj
ect, styledNode, allowVisitedStyle); |
2305 case CSSPropertyBorderWidth: | 2305 case CSSPropertyBorderWidth: |
2306 return valuesForSidesShorthand(borderWidthShorthand(), style, renderer,
styledNode, allowVisitedStyle); | 2306 return valuesForSidesShorthand(borderWidthShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); |
2307 case CSSPropertyWebkitColumnRule: | 2307 case CSSPropertyWebkitColumnRule: |
2308 return valuesForShorthandProperty(webkitColumnRuleShorthand(), style, re
nderer, styledNode, allowVisitedStyle); | 2308 return valuesForShorthandProperty(webkitColumnRuleShorthand(), style, la
youtObject, styledNode, allowVisitedStyle); |
2309 case CSSPropertyWebkitColumns: | 2309 case CSSPropertyWebkitColumns: |
2310 return valuesForShorthandProperty(webkitColumnsShorthand(), style, rende
rer, styledNode, allowVisitedStyle); | 2310 return valuesForShorthandProperty(webkitColumnsShorthand(), style, layou
tObject, styledNode, allowVisitedStyle); |
2311 case CSSPropertyListStyle: | 2311 case CSSPropertyListStyle: |
2312 return valuesForShorthandProperty(listStyleShorthand(), style, renderer,
styledNode, allowVisitedStyle); | 2312 return valuesForShorthandProperty(listStyleShorthand(), style, layoutObj
ect, styledNode, allowVisitedStyle); |
2313 case CSSPropertyMargin: | 2313 case CSSPropertyMargin: |
2314 return valuesForSidesShorthand(marginShorthand(), style, renderer, style
dNode, allowVisitedStyle); | 2314 return valuesForSidesShorthand(marginShorthand(), style, layoutObject, s
tyledNode, allowVisitedStyle); |
2315 case CSSPropertyOutline: | 2315 case CSSPropertyOutline: |
2316 return valuesForShorthandProperty(outlineShorthand(), style, renderer, s
tyledNode, allowVisitedStyle); | 2316 return valuesForShorthandProperty(outlineShorthand(), style, layoutObjec
t, styledNode, allowVisitedStyle); |
2317 case CSSPropertyPadding: | 2317 case CSSPropertyPadding: |
2318 return valuesForSidesShorthand(paddingShorthand(), style, renderer, styl
edNode, allowVisitedStyle); | 2318 return valuesForSidesShorthand(paddingShorthand(), style, layoutObject,
styledNode, allowVisitedStyle); |
2319 // Individual properties not part of the spec. | 2319 // Individual properties not part of the spec. |
2320 case CSSPropertyBackgroundRepeatX: | 2320 case CSSPropertyBackgroundRepeatX: |
2321 case CSSPropertyBackgroundRepeatY: | 2321 case CSSPropertyBackgroundRepeatY: |
2322 return nullptr; | 2322 return nullptr; |
2323 | 2323 |
2324 case CSSPropertyMotion: | 2324 case CSSPropertyMotion: |
2325 ASSERT(RuntimeEnabledFeatures::cssMotionPathEnabled()); | 2325 ASSERT(RuntimeEnabledFeatures::cssMotionPathEnabled()); |
2326 return valuesForShorthandProperty(motionShorthand(), style, renderer, st
yledNode, allowVisitedStyle); | 2326 return valuesForShorthandProperty(motionShorthand(), style, layoutObject
, styledNode, allowVisitedStyle); |
2327 | 2327 |
2328 case CSSPropertyMotionPath: { | 2328 case CSSPropertyMotionPath: { |
2329 ASSERT(RuntimeEnabledFeatures::cssMotionPathEnabled()); | 2329 ASSERT(RuntimeEnabledFeatures::cssMotionPathEnabled()); |
2330 const StyleMotionPath* styleMotionPath = style.motionPath(); | 2330 const StyleMotionPath* styleMotionPath = style.motionPath(); |
2331 if (!styleMotionPath) | 2331 if (!styleMotionPath) |
2332 return cssValuePool().createIdentifierValue(CSSValueNone); | 2332 return cssValuePool().createIdentifierValue(CSSValueNone); |
2333 | 2333 |
2334 ASSERT(styleMotionPath->isPathStyleMotionPath()); | 2334 ASSERT(styleMotionPath->isPathStyleMotionPath()); |
2335 return CSSPathValue::create(toPathStyleMotionPath(styleMotionPath)->path
String()); | 2335 return CSSPathValue::create(toPathStyleMotionPath(styleMotionPath)->path
String()); |
2336 } | 2336 } |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2543 case CSSPropertyAll: | 2543 case CSSPropertyAll: |
2544 return nullptr; | 2544 return nullptr; |
2545 default: | 2545 default: |
2546 break; | 2546 break; |
2547 } | 2547 } |
2548 ASSERT_NOT_REACHED(); | 2548 ASSERT_NOT_REACHED(); |
2549 return nullptr; | 2549 return nullptr; |
2550 } | 2550 } |
2551 | 2551 |
2552 } | 2552 } |
OLD | NEW |