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

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

Issue 138443013: Remove iframe@seamless (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Include remove tests Created 6 years, 11 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
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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 // Now check SMIL animation override style. 576 // Now check SMIL animation override style.
577 if (includeSMILProperties && state.element()->isSVGElement()) 577 if (includeSMILProperties && state.element()->isSVGElement())
578 collector.addElementStyleProperties(toSVGElement(state.element())->a nimatedSMILStyleProperties(), false /* isCacheable */); 578 collector.addElementStyleProperties(toSVGElement(state.element())->a nimatedSMILStyleProperties(), false /* isCacheable */);
579 } 579 }
580 } 580 }
581 581
582 PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document& document, CSSF ontSelector* fontSelector) 582 PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document& document, CSSF ontSelector* fontSelector)
583 { 583 {
584 const Frame* frame = document.frame(); 584 const Frame* frame = document.frame();
585 585
586 // HTML5 states that seamless iframes should replace default CSS values
587 // with values inherited from the containing iframe element. However,
588 // some values (such as the case of designMode = "on") still need to
589 // be set by this "document style".
590 RefPtr<RenderStyle> documentStyle = RenderStyle::create(); 586 RefPtr<RenderStyle> documentStyle = RenderStyle::create();
591 bool seamlessWithParent = document.shouldDisplaySeamlesslyWithParent(); 587 documentStyle->setDisplay(BLOCK);
592 if (seamlessWithParent) { 588 documentStyle->setRTLOrdering(document.visuallyOrdered() ? VisualOrder : Log icalOrder);
593 RenderStyle* iframeStyle = document.seamlessParentIFrame()->renderStyle( ); 589 documentStyle->setZoom(frame && !document.printing() ? frame->pageZoomFactor () : 1);
594 if (iframeStyle) 590 documentStyle->setLocale(document.contentLanguage());
595 documentStyle->inheritFrom(iframeStyle);
596 }
597 591
598 // FIXME: It's not clear which values below we want to override in the seaml ess case!
599 documentStyle->setDisplay(BLOCK);
600 if (!seamlessWithParent) {
601 documentStyle->setRTLOrdering(document.visuallyOrdered() ? VisualOrder : LogicalOrder);
602 documentStyle->setZoom(frame && !document.printing() ? frame->pageZoomFa ctor() : 1);
603 documentStyle->setLocale(document.contentLanguage());
604 }
605 // This overrides any -webkit-user-modify inherited from the parent iframe. 592 // This overrides any -webkit-user-modify inherited from the parent iframe.
606 documentStyle->setUserModify(document.inDesignMode() ? READ_WRITE : READ_ONL Y); 593 documentStyle->setUserModify(document.inDesignMode() ? READ_WRITE : READ_ONL Y);
607 594
608 document.setStyleDependentState(documentStyle.get()); 595 document.setStyleDependentState(documentStyle.get());
609 return documentStyle.release(); 596 return documentStyle.release();
610 } 597 }
611 598
612 // FIXME: This is duplicated with StyleAdjuster.cpp 599 // FIXME: This is duplicated with StyleAdjuster.cpp
613 // Perhaps this should move onto ElementResolveContext or even Element? 600 // Perhaps this should move onto ElementResolveContext or even Element?
614 static inline bool isAtShadowBoundary(const Element* element) 601 static inline bool isAtShadowBoundary(const Element* element)
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 bool StyleResolver::mediaQueryAffectedByViewportChange() const 1501 bool StyleResolver::mediaQueryAffectedByViewportChange() const
1515 { 1502 {
1516 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { 1503 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) {
1517 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result) 1504 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result)
1518 return true; 1505 return true;
1519 } 1506 }
1520 return false; 1507 return false;
1521 } 1508 }
1522 1509
1523 } // namespace WebCore 1510 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698