| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
| 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 9 * 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. (http://www.t
orchmobile.com/) |
| 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 } | 401 } |
| 402 | 402 |
| 403 ASSERT(list->length() == 2); | 403 ASSERT(list->length() == 2); |
| 404 CSSPrimitiveValue* second = toCSSPrimitiveValue(list->item(1)); | 404 CSSPrimitiveValue* second = toCSSPrimitiveValue(list->item(1)); |
| 405 ASSERT(second->isNumber()); | 405 ASSERT(second->isNumber()); |
| 406 int position = second->getIntValue(); | 406 int position = second->getIntValue(); |
| 407 ASSERT(position > 0 && position <= 100); | 407 ASSERT(position > 0 && position <= 100); |
| 408 state.style()->setSnapHeightPosition(position); | 408 state.style()->setSnapHeightPosition(position); |
| 409 } | 409 } |
| 410 | 410 |
| 411 void StyleBuilderFunctions::applyInitialCSSPropertySnapWidth(StyleResolverState&
state) |
| 412 { |
| 413 state.style()->setSnapWidth(LayoutUnit()); |
| 414 } |
| 415 |
| 416 void StyleBuilderFunctions::applyInheritCSSPropertySnapWidth(StyleResolverState&
state) |
| 417 { |
| 418 state.style()->setSnapWidth(state.parentStyle()->snapWidth()); |
| 419 } |
| 420 |
| 421 void StyleBuilderFunctions::applyValueCSSPropertySnapWidth(StyleResolverState& s
tate, CSSValue* value) |
| 422 { |
| 423 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 424 ASSERT(primitiveValue->isLength()); |
| 425 LayoutUnit unit = LayoutUnit::fromFloatCeil(primitiveValue->computeLength<fl
oat>(state.cssToLengthConversionData())); |
| 426 ASSERT(unit >= 0); |
| 427 const int kMaxSnapWidth = (1 << StyleRareNonInheritedData::kSnapWidthBits) -
1; |
| 428 state.style()->setSnapWidth(std::min(unit, LayoutUnit(kMaxSnapWidth))); |
| 429 } |
| 430 |
| 411 void StyleBuilderFunctions::applyValueCSSPropertyTextAlign(StyleResolverState& s
tate, CSSValue* value) | 431 void StyleBuilderFunctions::applyValueCSSPropertyTextAlign(StyleResolverState& s
tate, CSSValue* value) |
| 412 { | 432 { |
| 413 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 433 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 414 if (primitiveValue->isValueID() && primitiveValue->getValueID() != CSSValueW
ebkitMatchParent) | 434 if (primitiveValue->isValueID() && primitiveValue->getValueID() != CSSValueW
ebkitMatchParent) |
| 415 state.style()->setTextAlign(primitiveValue->convertTo<ETextAlign>()); | 435 state.style()->setTextAlign(primitiveValue->convertTo<ETextAlign>()); |
| 416 else if (state.parentStyle()->textAlign() == TASTART) | 436 else if (state.parentStyle()->textAlign() == TASTART) |
| 417 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection(
) ? LEFT : RIGHT); | 437 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection(
) ? LEFT : RIGHT); |
| 418 else if (state.parentStyle()->textAlign() == TAEND) | 438 else if (state.parentStyle()->textAlign() == TAEND) |
| 419 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection(
) ? RIGHT : LEFT); | 439 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection(
) ? RIGHT : LEFT); |
| 420 else | 440 else |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 } | 841 } |
| 822 } | 842 } |
| 823 | 843 |
| 824 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState&
state) | 844 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState&
state) |
| 825 { | 845 { |
| 826 if (!state.parentNode()->isDocumentNode()) | 846 if (!state.parentNode()->isDocumentNode()) |
| 827 state.style()->setPosition(state.parentStyle()->position()); | 847 state.style()->setPosition(state.parentStyle()->position()); |
| 828 } | 848 } |
| 829 | 849 |
| 830 } // namespace blink | 850 } // namespace blink |
| OLD | NEW |