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

Side by Side Diff: Source/core/dom/Element.cpp

Issue 18080016: [CSS Regions] Elements in a region should be assignable to a named flow (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Implemented suggestions from esprehn 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2313 matching lines...) Expand 10 before | Expand all | Expand 10 after
2324 bool Element::isInCanvasSubtree() const 2324 bool Element::isInCanvasSubtree() const
2325 { 2325 {
2326 return hasRareData() && elementRareData()->isInCanvasSubtree(); 2326 return hasRareData() && elementRareData()->isInCanvasSubtree();
2327 } 2327 }
2328 2328
2329 bool Element::isUnresolvedCustomElement() 2329 bool Element::isUnresolvedCustomElement()
2330 { 2330 {
2331 return isCustomElement() && document()->registry()->isUnresolved(this); 2331 return isCustomElement() && document()->registry()->isUnresolved(this);
2332 } 2332 }
2333 2333
2334 void Element::setIsInsideRegion(bool value)
2335 {
2336 if (value == isInsideRegion())
2337 return;
2338
2339 ensureElementRareData()->setIsInsideRegion(value);
2340 }
2341
2342 bool Element::isInsideRegion() const
2343 {
2344 return hasRareData() ? elementRareData()->isInsideRegion() : false;
2345 }
2346
2334 void Element::setRegionOversetState(RegionOversetState state) 2347 void Element::setRegionOversetState(RegionOversetState state)
2335 { 2348 {
2336 ensureElementRareData()->setRegionOversetState(state); 2349 ensureElementRareData()->setRegionOversetState(state);
2337 } 2350 }
2338 2351
2339 RegionOversetState Element::regionOversetState() const 2352 RegionOversetState Element::regionOversetState() const
2340 { 2353 {
2341 return hasRareData() ? elementRareData()->regionOversetState() : RegionUndef ined; 2354 return hasRareData() ? elementRareData()->regionOversetState() : RegionUndef ined;
2342 } 2355 }
2343 2356
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
2622 } 2635 }
2623 2636
2624 RenderRegion* Element::renderRegion() const 2637 RenderRegion* Element::renderRegion() const
2625 { 2638 {
2626 if (renderer() && renderer()->isRenderRegion()) 2639 if (renderer() && renderer()->isRenderRegion())
2627 return toRenderRegion(renderer()); 2640 return toRenderRegion(renderer());
2628 2641
2629 return 0; 2642 return 0;
2630 } 2643 }
2631 2644
2645 bool Element::shouldMoveToFlowThread(RenderStyle* styleToUse) const
2646 {
2647 ASSERT(styleToUse);
2648
2649 #if ENABLE(FULLSCREEN_API)
2650 if (FullScreenController::isActiveFullScreenElement(this))
2651 return false;
2652 #endif
2653
2654 if (isInShadowTree())
2655 return false;
2656
2657 if (styleToUse->flowThread().isEmpty())
2658 return false;
2659
2660 return !this->isRegisteredWithNamedFlow(document()->renderView()->flowThread Controller());
esprehn 2013/07/01 18:27:19 I don't think you need "this->"
2661 }
2662
2632 const AtomicString& Element::webkitRegionOverset() const 2663 const AtomicString& Element::webkitRegionOverset() const
2633 { 2664 {
2634 document()->updateLayoutIgnorePendingStylesheets(); 2665 document()->updateLayoutIgnorePendingStylesheets();
2635 2666
2636 DEFINE_STATIC_LOCAL(AtomicString, undefinedState, ("undefined", AtomicString ::ConstructFromLiteral)); 2667 DEFINE_STATIC_LOCAL(AtomicString, undefinedState, ("undefined", AtomicString ::ConstructFromLiteral));
2637 if (!RuntimeEnabledFeatures::cssRegionsEnabled() || !renderRegion()) 2668 if (!RuntimeEnabledFeatures::cssRegionsEnabled() || !renderRegion())
2638 return undefinedState; 2669 return undefinedState;
2639 2670
2640 switch (renderRegion()->regionOversetState()) { 2671 switch (renderRegion()->regionOversetState()) {
2641 case RegionFit: { 2672 case RegionFit: {
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
3566 return 0; 3597 return 0;
3567 } 3598 }
3568 3599
3569 Attribute* UniqueElementData::attributeItem(unsigned index) 3600 Attribute* UniqueElementData::attributeItem(unsigned index)
3570 { 3601 {
3571 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3602 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3572 return &m_attributeVector.at(index); 3603 return &m_attributeVector.at(index);
3573 } 3604 }
3574 3605
3575 } // namespace WebCore 3606 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698