| 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, 2013 Apple Inc. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
| 6 * All rights reserved. | 6 * 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. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "wtf/Assertions.h" | 52 #include "wtf/Assertions.h" |
| 53 | 53 |
| 54 namespace blink { | 54 namespace blink { |
| 55 | 55 |
| 56 using namespace HTMLNames; | 56 using namespace HTMLNames; |
| 57 | 57 |
| 58 static EDisplay equivalentBlockDisplay(EDisplay display) { | 58 static EDisplay equivalentBlockDisplay(EDisplay display) { |
| 59 switch (display) { | 59 switch (display) { |
| 60 case EDisplay::Block: | 60 case EDisplay::Block: |
| 61 case EDisplay::Table: | 61 case EDisplay::Table: |
| 62 case EDisplay::Box: | 62 case EDisplay::WebkitBox: |
| 63 case EDisplay::Flex: | 63 case EDisplay::Flex: |
| 64 case EDisplay::Grid: | 64 case EDisplay::Grid: |
| 65 case EDisplay::ListItem: | 65 case EDisplay::ListItem: |
| 66 return display; | 66 return display; |
| 67 case EDisplay::InlineTable: | 67 case EDisplay::InlineTable: |
| 68 return EDisplay::Table; | 68 return EDisplay::Table; |
| 69 case EDisplay::InlineBox: | 69 case EDisplay::WebkitInlineBox: |
| 70 return EDisplay::Box; | 70 return EDisplay::WebkitBox; |
| 71 case EDisplay::InlineFlex: | 71 case EDisplay::InlineFlex: |
| 72 return EDisplay::Flex; | 72 return EDisplay::Flex; |
| 73 case EDisplay::InlineGrid: | 73 case EDisplay::InlineGrid: |
| 74 return EDisplay::Grid; | 74 return EDisplay::Grid; |
| 75 | 75 |
| 76 case EDisplay::Inline: | 76 case EDisplay::Inline: |
| 77 case EDisplay::InlineBlock: | 77 case EDisplay::InlineBlock: |
| 78 case EDisplay::TableRowGroup: | 78 case EDisplay::TableRowGroup: |
| 79 case EDisplay::TableHeaderGroup: | 79 case EDisplay::TableHeaderGroup: |
| 80 case EDisplay::TableFooterGroup: | 80 case EDisplay::TableFooterGroup: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 99 } | 99 } |
| 100 | 100 |
| 101 // CSS requires text-decoration to be reset at each DOM element for | 101 // CSS requires text-decoration to be reset at each DOM element for |
| 102 // inline blocks, inline tables, shadow DOM crossings, floating elements, | 102 // inline blocks, inline tables, shadow DOM crossings, floating elements, |
| 103 // and absolute or relatively positioned elements. Outermost <svg> roots are | 103 // and absolute or relatively positioned elements. Outermost <svg> roots are |
| 104 // considered to be atomic inline-level. | 104 // considered to be atomic inline-level. |
| 105 static bool doesNotInheritTextDecoration(const ComputedStyle& style, | 105 static bool doesNotInheritTextDecoration(const ComputedStyle& style, |
| 106 const Element* element) { | 106 const Element* element) { |
| 107 return style.display() == EDisplay::InlineTable || | 107 return style.display() == EDisplay::InlineTable || |
| 108 style.display() == EDisplay::InlineBlock || | 108 style.display() == EDisplay::InlineBlock || |
| 109 style.display() == EDisplay::InlineBox || | 109 style.display() == EDisplay::WebkitInlineBox || |
| 110 isAtShadowBoundary(element) || style.isFloating() || | 110 isAtShadowBoundary(element) || style.isFloating() || |
| 111 style.hasOutOfFlowPosition() || isOutermostSVGElement(element) || | 111 style.hasOutOfFlowPosition() || isOutermostSVGElement(element) || |
| 112 isHTMLRTElement(element); | 112 isHTMLRTElement(element); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // Certain elements (<a>, <font>) override text decoration colors. "The font | 115 // Certain elements (<a>, <font>) override text decoration colors. "The font |
| 116 // element is expected to override the color of any text decoration that spans | 116 // element is expected to override the color of any text decoration that spans |
| 117 // the text of the element to the used value of the element's 'color' property." | 117 // the text of the element to the used value of the element's 'color' property." |
| 118 // (https://html.spec.whatwg.org/multipage/rendering.html#phrasing-content-3) | 118 // (https://html.spec.whatwg.org/multipage/rendering.html#phrasing-content-3) |
| 119 // The <a> behavior is non-standard. | 119 // The <a> behavior is non-standard. |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 style.display() == EDisplay::TableHeaderGroup || | 357 style.display() == EDisplay::TableHeaderGroup || |
| 358 style.display() == EDisplay::TableRow || | 358 style.display() == EDisplay::TableRow || |
| 359 style.display() == EDisplay::TableRowGroup || | 359 style.display() == EDisplay::TableRowGroup || |
| 360 style.display() == EDisplay::TableCell) | 360 style.display() == EDisplay::TableCell) |
| 361 style.setWritingMode(parentStyle.getWritingMode()); | 361 style.setWritingMode(parentStyle.getWritingMode()); |
| 362 | 362 |
| 363 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow | 363 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow |
| 364 // setting of block-flow to anything other than TopToBottomWritingMode. | 364 // setting of block-flow to anything other than TopToBottomWritingMode. |
| 365 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. | 365 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. |
| 366 if (style.getWritingMode() != TopToBottomWritingMode && | 366 if (style.getWritingMode() != TopToBottomWritingMode && |
| 367 (style.display() == EDisplay::Box || | 367 (style.display() == EDisplay::WebkitBox || |
| 368 style.display() == EDisplay::InlineBox)) | 368 style.display() == EDisplay::WebkitInlineBox)) |
| 369 style.setWritingMode(TopToBottomWritingMode); | 369 style.setWritingMode(TopToBottomWritingMode); |
| 370 | 370 |
| 371 if (parentStyle.isDisplayFlexibleOrGridBox()) { | 371 if (parentStyle.isDisplayFlexibleOrGridBox()) { |
| 372 style.setFloating(EFloat::None); | 372 style.setFloating(EFloat::None); |
| 373 style.setDisplay(equivalentBlockDisplay(style.display())); | 373 style.setDisplay(equivalentBlockDisplay(style.display())); |
| 374 | 374 |
| 375 // We want to count vertical percentage paddings/margins on flex items | 375 // We want to count vertical percentage paddings/margins on flex items |
| 376 // because our current behavior is different from the spec and we want to | 376 // because our current behavior is different from the spec and we want to |
| 377 // gather compatibility data. | 377 // gather compatibility data. |
| 378 if (style.paddingBefore().isPercentOrCalc() || | 378 if (style.paddingBefore().isPercentOrCalc() || |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 style.setDisplay(EDisplay::Block); | 476 style.setDisplay(EDisplay::Block); |
| 477 | 477 |
| 478 // Columns don't apply to svg text elements. | 478 // Columns don't apply to svg text elements. |
| 479 if (isSVGTextElement(*element)) | 479 if (isSVGTextElement(*element)) |
| 480 style.clearMultiCol(); | 480 style.clearMultiCol(); |
| 481 } | 481 } |
| 482 adjustStyleForAlignment(style, parentStyle); | 482 adjustStyleForAlignment(style, parentStyle); |
| 483 } | 483 } |
| 484 | 484 |
| 485 } // namespace blink | 485 } // namespace blink |
| OLD | NEW |