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

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: 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::setIsDOMChildOfRegion(bool value)
2335 {
2336 if (value == isDOMChildOfRegion())
2337 return; // Will always be called during attaching, don't create rare dat a structure if not necessary.
esprehn 2013/06/28 20:29:36 Remove the comment. This kind of oldValue == newVa
2338
2339 ensureElementRareData()->setIsDOMChildOfRegion(value);
2340 }
2341
2342 bool Element::isDOMChildOfRegion() const
2343 {
2344 return hasRareData() ? elementRareData()->isDOMChildOfRegion() : 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 Document* doc = document();
esprehn 2013/06/28 20:29:36 Remove this, just call document() below. You do it
2648
2649 if (!RuntimeEnabledFeatures::cssRegionsEnabled())
esprehn 2013/06/28 20:29:36 This check should probably be in NodeRenderingCont
2650 return false;
2651
2652 ASSERT(styleToUse);
2653 if (!styleToUse)
2654 return false;
esprehn 2013/06/28 20:29:36 Remove this, if you're asserting you shouldn't be
2655
2656 #if ENABLE(FULLSCREEN_API)
2657 if (doc->webkitIsFullScreen() && doc->webkitCurrentFullScreenElement() == th is)
esprehn 2013/06/28 20:29:36 FullScreenController::isActiveFullScreenElement(th
2658 return false;
2659 #endif
2660
2661 if (isInShadowTree())
2662 return false;
esprehn 2013/06/28 20:29:36 Interesting, so nothing inside a shadow is ever in
stavila 2013/07/01 15:33:39 For the moment, no. It is still under discussion a
2663
2664 if (styleToUse->flowThread().isEmpty())
2665 return false;
2666
2667 return !document()->renderView()->flowThreadController()->isContentNodeRegis teredWithAnyNamedFlow(this);
2668 }
2669
2632 const AtomicString& Element::webkitRegionOverset() const 2670 const AtomicString& Element::webkitRegionOverset() const
2633 { 2671 {
2634 document()->updateLayoutIgnorePendingStylesheets(); 2672 document()->updateLayoutIgnorePendingStylesheets();
2635 2673
2636 DEFINE_STATIC_LOCAL(AtomicString, undefinedState, ("undefined", AtomicString ::ConstructFromLiteral)); 2674 DEFINE_STATIC_LOCAL(AtomicString, undefinedState, ("undefined", AtomicString ::ConstructFromLiteral));
2637 if (!RuntimeEnabledFeatures::cssRegionsEnabled() || !renderRegion()) 2675 if (!RuntimeEnabledFeatures::cssRegionsEnabled() || !renderRegion())
2638 return undefinedState; 2676 return undefinedState;
2639 2677
2640 switch (renderRegion()->regionOversetState()) { 2678 switch (renderRegion()->regionOversetState()) {
2641 case RegionFit: { 2679 case RegionFit: {
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
3566 return 0; 3604 return 0;
3567 } 3605 }
3568 3606
3569 Attribute* UniqueElementData::attributeItem(unsigned index) 3607 Attribute* UniqueElementData::attributeItem(unsigned index)
3570 { 3608 {
3571 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3609 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3572 return &m_attributeVector.at(index); 3610 return &m_attributeVector.at(index);
3573 } 3611 }
3574 3612
3575 } // namespace WebCore 3613 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698