| 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. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
| 7 * All rights reserved. | 7 * All rights reserved. |
| 8 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 8 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 9 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 9 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 10 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 toCSSIdentifierValue(value).getValueID() != CSSValueWebkitMatchParent) { | 502 toCSSIdentifierValue(value).getValueID() != CSSValueWebkitMatchParent) { |
| 503 // Special case for th elements - UA stylesheet text-align does not apply if | 503 // Special case for th elements - UA stylesheet text-align does not apply if |
| 504 // parent's computed value for text-align is not its initial value | 504 // parent's computed value for text-align is not its initial value |
| 505 // https://html.spec.whatwg.org/multipage/rendering.html#tables-2 | 505 // https://html.spec.whatwg.org/multipage/rendering.html#tables-2 |
| 506 const CSSIdentifierValue& identValue = toCSSIdentifierValue(value); | 506 const CSSIdentifierValue& identValue = toCSSIdentifierValue(value); |
| 507 if (identValue.getValueID() == CSSValueInternalCenter && | 507 if (identValue.getValueID() == CSSValueInternalCenter && |
| 508 state.parentStyle()->textAlign() != ComputedStyle::initialTextAlign()) | 508 state.parentStyle()->textAlign() != ComputedStyle::initialTextAlign()) |
| 509 state.style()->setTextAlign(state.parentStyle()->textAlign()); | 509 state.style()->setTextAlign(state.parentStyle()->textAlign()); |
| 510 else | 510 else |
| 511 state.style()->setTextAlign(identValue.convertTo<ETextAlign>()); | 511 state.style()->setTextAlign(identValue.convertTo<ETextAlign>()); |
| 512 } else if (state.parentStyle()->textAlign() == TASTART) | 512 } else if (state.parentStyle()->textAlign() == ETextAlign::Start) { |
| 513 state.style()->setTextAlign( | 513 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection() |
| 514 state.parentStyle()->isLeftToRightDirection() ? LEFT : RIGHT); | 514 ? ETextAlign::Left |
| 515 else if (state.parentStyle()->textAlign() == TAEND) | 515 : ETextAlign::Right); |
| 516 state.style()->setTextAlign( | 516 } else if (state.parentStyle()->textAlign() == ETextAlign::End) { |
| 517 state.parentStyle()->isLeftToRightDirection() ? RIGHT : LEFT); | 517 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection() |
| 518 else | 518 ? ETextAlign::Right |
| 519 : ETextAlign::Left); |
| 520 } else { |
| 519 state.style()->setTextAlign(state.parentStyle()->textAlign()); | 521 state.style()->setTextAlign(state.parentStyle()->textAlign()); |
| 522 } |
| 520 } | 523 } |
| 521 | 524 |
| 522 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent( | 525 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent( |
| 523 StyleResolverState& state) { | 526 StyleResolverState& state) { |
| 524 state.style()->setTextIndent(state.parentStyle()->textIndent()); | 527 state.style()->setTextIndent(state.parentStyle()->textIndent()); |
| 525 state.style()->setTextIndentLine(state.parentStyle()->getTextIndentLine()); | 528 state.style()->setTextIndentLine(state.parentStyle()->getTextIndentLine()); |
| 526 state.style()->setTextIndentType(state.parentStyle()->getTextIndentType()); | 529 state.style()->setTextIndentType(state.parentStyle()->getTextIndentType()); |
| 527 } | 530 } |
| 528 | 531 |
| 529 void StyleBuilderFunctions::applyInitialCSSPropertyTextIndent( | 532 void StyleBuilderFunctions::applyInitialCSSPropertyTextIndent( |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 } | 1035 } |
| 1033 } | 1036 } |
| 1034 | 1037 |
| 1035 void StyleBuilderFunctions::applyInheritCSSPropertyPosition( | 1038 void StyleBuilderFunctions::applyInheritCSSPropertyPosition( |
| 1036 StyleResolverState& state) { | 1039 StyleResolverState& state) { |
| 1037 if (!state.parentNode()->isDocumentNode()) | 1040 if (!state.parentNode()->isDocumentNode()) |
| 1038 state.style()->setPosition(state.parentStyle()->position()); | 1041 state.style()->setPosition(state.parentStyle()->position()); |
| 1039 } | 1042 } |
| 1040 | 1043 |
| 1041 } // namespace blink | 1044 } // namespace blink |
| OLD | NEW |