Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 17654008: Implement the ::backdrop pseudo-element for modal <dialog>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSSelector.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 ASSERT(parentStyle); 1239 ASSERT(parentStyle);
1240 if (!e) 1240 if (!e)
1241 return 0; 1241 return 0;
1242 1242
1243 StyleResolverState& state = m_state; 1243 StyleResolverState& state = m_state;
1244 1244
1245 initElement(e); 1245 initElement(e);
1246 1246
1247 state.initForStyleResolve(document(), e, parentStyle); 1247 state.initForStyleResolve(document(), e, parentStyle);
1248 1248
1249 if (m_state.parentStyle()) { 1249 if (pseudoStyleRequest.pseudoId != BACKDROP && m_state.parentStyle()) { // T he spec disallows inheritance for ::backdrop.
1250 state.setStyle(RenderStyle::create()); 1250 state.setStyle(RenderStyle::create());
1251 state.style()->inheritFrom(m_state.parentStyle()); 1251 state.style()->inheritFrom(m_state.parentStyle());
1252 } else { 1252 } else {
1253 state.setStyle(defaultStyleForElement()); 1253 state.setStyle(defaultStyleForElement());
1254 state.setParentStyle(RenderStyle::clone(state.style())); 1254 state.setParentStyle(RenderStyle::clone(state.style()));
1255 } 1255 }
1256 1256
1257 // Since we don't use pseudo-elements in any of our quirk/print user agent r ules, don't waste time walking 1257 // Since we don't use pseudo-elements in any of our quirk/print user agent r ules, don't waste time walking
1258 // those rules. 1258 // those rules.
1259 1259
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 1488
1489 // FIXME: We shouldn't be overriding start/-webkit-auto like this. Do it in html.css instead. 1489 // FIXME: We shouldn't be overriding start/-webkit-auto like this. Do it in html.css instead.
1490 // Table headers with a text-align of -webkit-auto will change the text- align to center. 1490 // Table headers with a text-align of -webkit-auto will change the text- align to center.
1491 if (e && e->hasTagName(thTag) && style->textAlign() == TASTART) 1491 if (e && e->hasTagName(thTag) && style->textAlign() == TASTART)
1492 style->setTextAlign(CENTER); 1492 style->setTextAlign(CENTER);
1493 1493
1494 if (e && e->hasTagName(legendTag)) 1494 if (e && e->hasTagName(legendTag))
1495 style->setDisplay(BLOCK); 1495 style->setDisplay(BLOCK);
1496 1496
1497 // Per the spec, position 'static' and 'relative' in the top layer compu te to 'absolute'. 1497 // Per the spec, position 'static' and 'relative' in the top layer compu te to 'absolute'.
1498 if (e && e->isInTopLayer() && (style->position() == StaticPosition || st yle->position() == RelativePosition)) 1498 if ((e && e->isInTopLayer()) || style->styleType() == BACKDROP) {
1499 style->setPosition(AbsolutePosition); 1499 if (style->position() == StaticPosition || style->position() == Rela tivePosition)
1500 style->setPosition(AbsolutePosition);
1501 }
1500 1502
1501 // Absolute/fixed positioned elements, floating elements and the documen t element need block-like outside display. 1503 // Absolute/fixed positioned elements, floating elements and the documen t element need block-like outside display.
1502 if (style->hasOutOfFlowPosition() || style->isFloating() || (e && e->doc ument()->documentElement() == e)) 1504 if (style->hasOutOfFlowPosition() || style->isFloating() || (e && e->doc ument()->documentElement() == e))
1503 style->setDisplay(equivalentBlockDisplay(style->display(), style->is Floating(), !document()->inQuirksMode())); 1505 style->setDisplay(equivalentBlockDisplay(style->display(), style->is Floating(), !document()->inQuirksMode()));
1504 1506
1505 // FIXME: Don't support this mutation for pseudo styles like first-lette r or first-line, since it's not completely 1507 // FIXME: Don't support this mutation for pseudo styles like first-lette r or first-line, since it's not completely
1506 // clear how that should work. 1508 // clear how that should work.
1507 if (style->display() == INLINE && style->styleType() == NOPSEUDO && styl e->writingMode() != parentStyle->writingMode()) 1509 if (style->display() == INLINE && style->styleType() == NOPSEUDO && styl e->writingMode() != parentStyle->writingMode())
1508 style->setDisplay(INLINE_BLOCK); 1510 style->setDisplay(INLINE_BLOCK);
1509 1511
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 if (style->hasAutoZIndex() && ((e && e->document()->documentElement() == e) 1546 if (style->hasAutoZIndex() && ((e && e->document()->documentElement() == e)
1545 || style->opacity() < 1.0f 1547 || style->opacity() < 1.0f
1546 || style->hasTransformRelatedProperty() 1548 || style->hasTransformRelatedProperty()
1547 || style->hasMask() 1549 || style->hasMask()
1548 || style->clipPath() 1550 || style->clipPath()
1549 || style->boxReflect() 1551 || style->boxReflect()
1550 || style->hasFilter() 1552 || style->hasFilter()
1551 || style->hasBlendMode() 1553 || style->hasBlendMode()
1552 || style->position() == StickyPosition 1554 || style->position() == StickyPosition
1553 || (style->position() == FixedPosition && e && e->document()->page() && e->document()->page()->settings()->fixedPositionCreatesStackingContext()) 1555 || (style->position() == FixedPosition && e && e->document()->page() && e->document()->page()->settings()->fixedPositionCreatesStackingContext())
1554 || (e && e->isInTopLayer()) 1556 || ((e && e->isInTopLayer()) || style->styleType() == BACKDROP)
Julien - ping for review 2013/07/03 01:48:05 This is now repeated twice, which means a helper f
falken 2013/07/03 06:14:48 Done.
1555 )) 1557 ))
1556 style->setZIndex(0); 1558 style->setZIndex(0);
1557 1559
1558 // Textarea considers overflow visible as auto. 1560 // Textarea considers overflow visible as auto.
1559 if (e && e->hasTagName(textareaTag)) { 1561 if (e && e->hasTagName(textareaTag)) {
1560 style->setOverflowX(style->overflowX() == OVISIBLE ? OAUTO : style->over flowX()); 1562 style->setOverflowX(style->overflowX() == OVISIBLE ? OAUTO : style->over flowX());
1561 style->setOverflowY(style->overflowY() == OVISIBLE ? OAUTO : style->over flowY()); 1563 style->setOverflowY(style->overflowY() == OVISIBLE ? OAUTO : style->over flowY());
1562 } 1564 }
1563 1565
1564 // For now, <marquee> requires an overflow clip to work properly. 1566 // For now, <marquee> requires an overflow clip to work properly.
(...skipping 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after
3690 info.addMember(m_state, "state"); 3692 info.addMember(m_state, "state");
3691 3693
3692 // FIXME: move this to a place where it would be called only once? 3694 // FIXME: move this to a place where it would be called only once?
3693 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); 3695 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle");
3694 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl e"); 3696 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl e");
3695 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle" ); 3697 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle" );
3696 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo urceStyle"); 3698 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo urceStyle");
3697 } 3699 }
3698 3700
3699 } // namespace WebCore 3701 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSSelector.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698