Chromium Code Reviews| 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. All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) |
| 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| (...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1238 ASSERT(parentStyle); | 1238 ASSERT(parentStyle); |
| 1239 if (!e) | 1239 if (!e) |
| 1240 return 0; | 1240 return 0; |
| 1241 | 1241 |
| 1242 StyleResolverState& state = m_state; | 1242 StyleResolverState& state = m_state; |
| 1243 | 1243 |
| 1244 initElement(e); | 1244 initElement(e); |
| 1245 | 1245 |
| 1246 state.initForStyleResolve(document(), e, parentStyle); | 1246 state.initForStyleResolve(document(), e, parentStyle); |
| 1247 | 1247 |
| 1248 if (m_state.parentStyle()) { | 1248 if (pseudoStyleRequest.pseudoId != BACKDROP && m_state.parentStyle()) { |
|
Julien - ping for review
2013/06/27 22:49:00
It's weird to disallow style cascading for ::backd
falken
2013/06/28 08:06:52
The spec says ::backdrop "does not inherit from an
| |
| 1249 state.setStyle(RenderStyle::create()); | 1249 state.setStyle(RenderStyle::create()); |
| 1250 state.style()->inheritFrom(m_state.parentStyle()); | 1250 state.style()->inheritFrom(m_state.parentStyle()); |
| 1251 } else { | 1251 } else { |
| 1252 state.setStyle(defaultStyleForElement()); | 1252 state.setStyle(defaultStyleForElement()); |
| 1253 state.setParentStyle(RenderStyle::clone(state.style())); | 1253 state.setParentStyle(RenderStyle::clone(state.style())); |
| 1254 } | 1254 } |
| 1255 | 1255 |
| 1256 // Since we don't use pseudo-elements in any of our quirk/print user agent r ules, don't waste time walking | 1256 // Since we don't use pseudo-elements in any of our quirk/print user agent r ules, don't waste time walking |
| 1257 // those rules. | 1257 // those rules. |
| 1258 | 1258 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1487 | 1487 |
| 1488 // FIXME: We shouldn't be overriding start/-webkit-auto like this. Do it in html.css instead. | 1488 // FIXME: We shouldn't be overriding start/-webkit-auto like this. Do it in html.css instead. |
| 1489 // Table headers with a text-align of -webkit-auto will change the text- align to center. | 1489 // Table headers with a text-align of -webkit-auto will change the text- align to center. |
| 1490 if (e && e->hasTagName(thTag) && style->textAlign() == TASTART) | 1490 if (e && e->hasTagName(thTag) && style->textAlign() == TASTART) |
| 1491 style->setTextAlign(CENTER); | 1491 style->setTextAlign(CENTER); |
| 1492 | 1492 |
| 1493 if (e && e->hasTagName(legendTag)) | 1493 if (e && e->hasTagName(legendTag)) |
| 1494 style->setDisplay(BLOCK); | 1494 style->setDisplay(BLOCK); |
| 1495 | 1495 |
| 1496 // Per the spec, position 'static' and 'relative' in the top layer compu te to 'absolute'. | 1496 // Per the spec, position 'static' and 'relative' in the top layer compu te to 'absolute'. |
| 1497 if (e && e->isInTopLayer() && (style->position() == StaticPosition || st yle->position() == RelativePosition)) | 1497 if ((e && e->isInTopLayer()) || style->styleType() == BACKDROP) { |
| 1498 style->setPosition(AbsolutePosition); | 1498 if (style->position() == StaticPosition || style->position() == Rela tivePosition) |
| 1499 style->setPosition(AbsolutePosition); | |
| 1500 } | |
| 1499 | 1501 |
| 1500 // Absolute/fixed positioned elements, floating elements and the documen t element need block-like outside display. | 1502 // Absolute/fixed positioned elements, floating elements and the documen t element need block-like outside display. |
| 1501 if (style->hasOutOfFlowPosition() || style->isFloating() || (e && e->doc ument()->documentElement() == e)) | 1503 if (style->hasOutOfFlowPosition() || style->isFloating() || (e && e->doc ument()->documentElement() == e)) |
| 1502 style->setDisplay(equivalentBlockDisplay(style->display(), style->is Floating(), !document()->inQuirksMode())); | 1504 style->setDisplay(equivalentBlockDisplay(style->display(), style->is Floating(), !document()->inQuirksMode())); |
| 1503 | 1505 |
| 1504 // FIXME: Don't support this mutation for pseudo styles like first-lette r or first-line, since it's not completely | 1506 // FIXME: Don't support this mutation for pseudo styles like first-lette r or first-line, since it's not completely |
| 1505 // clear how that should work. | 1507 // clear how that should work. |
| 1506 if (style->display() == INLINE && style->styleType() == NOPSEUDO && styl e->writingMode() != parentStyle->writingMode()) | 1508 if (style->display() == INLINE && style->styleType() == NOPSEUDO && styl e->writingMode() != parentStyle->writingMode()) |
| 1507 style->setDisplay(INLINE_BLOCK); | 1509 style->setDisplay(INLINE_BLOCK); |
| 1508 | 1510 |
| (...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3685 info.addMember(m_state, "state"); | 3687 info.addMember(m_state, "state"); |
| 3686 | 3688 |
| 3687 // FIXME: move this to a place where it would be called only once? | 3689 // FIXME: move this to a place where it would be called only once? |
| 3688 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); | 3690 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); |
| 3689 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl e"); | 3691 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl e"); |
| 3690 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle" ); | 3692 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle" ); |
| 3691 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo urceStyle"); | 3693 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo urceStyle"); |
| 3692 } | 3694 } |
| 3693 | 3695 |
| 3694 } // namespace WebCore | 3696 } // namespace WebCore |
| OLD | NEW |