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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 } | 474 } |
475 | 475 |
476 void StyleAdjuster::AdjustComputedStyle(StyleResolverState& state, | 476 void StyleAdjuster::AdjustComputedStyle(StyleResolverState& state, |
477 Element* element) { | 477 Element* element) { |
478 DCHECK(state.LayoutParentStyle()); | 478 DCHECK(state.LayoutParentStyle()); |
479 DCHECK(state.ParentStyle()); | 479 DCHECK(state.ParentStyle()); |
480 ComputedStyle& style = state.MutableStyleRef(); | 480 ComputedStyle& style = state.MutableStyleRef(); |
481 const ComputedStyle& parent_style = *state.ParentStyle(); | 481 const ComputedStyle& parent_style = *state.ParentStyle(); |
482 const ComputedStyle& layout_parent_style = *state.LayoutParentStyle(); | 482 const ComputedStyle& layout_parent_style = *state.LayoutParentStyle(); |
483 | 483 |
| 484 if (style.Display() != EDisplay::kNone && element && |
| 485 element->IsHTMLElement()) { |
| 486 AdjustStyleForHTMLElement(style, ToHTMLElement(*element)); |
| 487 } |
484 if (style.Display() != EDisplay::kNone) { | 488 if (style.Display() != EDisplay::kNone) { |
485 if (element && element->IsHTMLElement()) | |
486 AdjustStyleForHTMLElement(style, ToHTMLElement(*element)); | |
487 | |
488 // Per the spec, position 'static' and 'relative' in the top layer compute | 489 // Per the spec, position 'static' and 'relative' in the top layer compute |
489 // to 'absolute'. | 490 // to 'absolute'. |
490 if (IsInTopLayer(element, style) && | 491 if (IsInTopLayer(element, style) && |
491 (style.GetPosition() == EPosition::kStatic || | 492 (style.GetPosition() == EPosition::kStatic || |
492 style.GetPosition() == EPosition::kRelative)) | 493 style.GetPosition() == EPosition::kRelative)) |
493 style.SetPosition(EPosition::kAbsolute); | 494 style.SetPosition(EPosition::kAbsolute); |
494 | 495 |
495 // Absolute/fixed positioned elements, floating elements and the document | 496 // Absolute/fixed positioned elements, floating elements and the document |
496 // element need block-like outside display. | 497 // element need block-like outside display. |
497 if (style.Display() != EDisplay::kContents && | 498 if (style.Display() != EDisplay::kContents && |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 element && element->ShadowPseudoId().StartsWith("-webkit-media-controls"); | 611 element && element->ShadowPseudoId().StartsWith("-webkit-media-controls"); |
611 if (is_media_control && style.Appearance() == kNoControlPart) { | 612 if (is_media_control && style.Appearance() == kNoControlPart) { |
612 // For compatibility reasons if the element is a media control and the | 613 // For compatibility reasons if the element is a media control and the |
613 // -webkit-appearance is none then we should clear the background image. | 614 // -webkit-appearance is none then we should clear the background image. |
614 if (!StyleResolver::HasAuthorBackground(state)) { | 615 if (!StyleResolver::HasAuthorBackground(state)) { |
615 style.MutableBackgroundInternal().ClearImage(); | 616 style.MutableBackgroundInternal().ClearImage(); |
616 } | 617 } |
617 } | 618 } |
618 } | 619 } |
619 } // namespace blink | 620 } // namespace blink |
OLD | NEW |