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

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

Issue 17176018: [CSS Regions] Add new regionOversetChange event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Integrated styling fixes Created 7 years, 6 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
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/ElementRareData.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) 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 2248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2259 bool Element::isInCanvasSubtree() const 2259 bool Element::isInCanvasSubtree() const
2260 { 2260 {
2261 return hasRareData() && elementRareData()->isInCanvasSubtree(); 2261 return hasRareData() && elementRareData()->isInCanvasSubtree();
2262 } 2262 }
2263 2263
2264 bool Element::isUnresolvedCustomElement() 2264 bool Element::isUnresolvedCustomElement()
2265 { 2265 {
2266 return isCustomElement() && document()->registry()->isUnresolved(this); 2266 return isCustomElement() && document()->registry()->isUnresolved(this);
2267 } 2267 }
2268 2268
2269 void Element::setRegionOversetState(RegionOversetState state)
2270 {
2271 ensureElementRareData()->setRegionOversetState(state);
2272 }
2273
2274 RegionOversetState Element::regionOversetState() const
2275 {
2276 return hasRareData() ? elementRareData()->regionOversetState() : RegionUndef ined;
2277 }
2278
2269 AtomicString Element::computeInheritedLanguage() const 2279 AtomicString Element::computeInheritedLanguage() const
2270 { 2280 {
2271 const Node* n = this; 2281 const Node* n = this;
2272 AtomicString value; 2282 AtomicString value;
2273 // The language property is inherited, so we iterate over the parents to fin d the first language. 2283 // The language property is inherited, so we iterate over the parents to fin d the first language.
2274 do { 2284 do {
2275 if (n->isElementNode()) { 2285 if (n->isElementNode()) {
2276 if (const ElementData* elementData = toElement(n)->elementData()) { 2286 if (const ElementData* elementData = toElement(n)->elementData()) {
2277 // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml 1/#C_7 2287 // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml 1/#C_7
2278 if (const Attribute* attribute = elementData->getAttributeItem(X MLNames::langAttr)) 2288 if (const Attribute* attribute = elementData->getAttributeItem(X MLNames::langAttr))
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
2555 } 2565 }
2556 2566
2557 const AtomicString& Element::webkitRegionOverset() const 2567 const AtomicString& Element::webkitRegionOverset() const
2558 { 2568 {
2559 document()->updateLayoutIgnorePendingStylesheets(); 2569 document()->updateLayoutIgnorePendingStylesheets();
2560 2570
2561 DEFINE_STATIC_LOCAL(AtomicString, undefinedState, ("undefined", AtomicString ::ConstructFromLiteral)); 2571 DEFINE_STATIC_LOCAL(AtomicString, undefinedState, ("undefined", AtomicString ::ConstructFromLiteral));
2562 if (!RuntimeEnabledFeatures::cssRegionsEnabled() || !renderRegion()) 2572 if (!RuntimeEnabledFeatures::cssRegionsEnabled() || !renderRegion())
2563 return undefinedState; 2573 return undefinedState;
2564 2574
2565 switch (renderRegion()->regionState()) { 2575 switch (renderRegion()->regionOversetState()) {
2566 case RenderRegion::RegionFit: { 2576 case RegionFit: {
2567 DEFINE_STATIC_LOCAL(AtomicString, fitState, ("fit", AtomicString::Constr uctFromLiteral)); 2577 DEFINE_STATIC_LOCAL(AtomicString, fitState, ("fit", AtomicString::Constr uctFromLiteral));
2568 return fitState; 2578 return fitState;
2569 } 2579 }
2570 case RenderRegion::RegionEmpty: { 2580 case RegionEmpty: {
2571 DEFINE_STATIC_LOCAL(AtomicString, emptyState, ("empty", AtomicString::Co nstructFromLiteral)); 2581 DEFINE_STATIC_LOCAL(AtomicString, emptyState, ("empty", AtomicString::Co nstructFromLiteral));
2572 return emptyState; 2582 return emptyState;
2573 } 2583 }
2574 case RenderRegion::RegionOverset: { 2584 case RegionOverset: {
2575 DEFINE_STATIC_LOCAL(AtomicString, overflowState, ("overset", AtomicStrin g::ConstructFromLiteral)); 2585 DEFINE_STATIC_LOCAL(AtomicString, overflowState, ("overset", AtomicStrin g::ConstructFromLiteral));
2576 return overflowState; 2586 return overflowState;
2577 } 2587 }
2578 case RenderRegion::RegionUndefined: 2588 case RegionUndefined:
2579 return undefinedState; 2589 return undefinedState;
2580 } 2590 }
2581 2591
2582 ASSERT_NOT_REACHED(); 2592 ASSERT_NOT_REACHED();
2583 return undefinedState; 2593 return undefinedState;
2584 } 2594 }
2585 2595
2586 Vector<RefPtr<Range> > Element::webkitGetRegionFlowRanges() const 2596 Vector<RefPtr<Range> > Element::webkitGetRegionFlowRanges() const
2587 { 2597 {
2588 document()->updateLayoutIgnorePendingStylesheets(); 2598 document()->updateLayoutIgnorePendingStylesheets();
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
3152 return 0; 3162 return 0;
3153 } 3163 }
3154 3164
3155 Attribute* UniqueElementData::attributeItem(unsigned index) 3165 Attribute* UniqueElementData::attributeItem(unsigned index)
3156 { 3166 {
3157 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3167 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3158 return &m_attributeVector.at(index); 3168 return &m_attributeVector.at(index);
3159 } 3169 }
3160 3170
3161 } // namespace WebCore 3171 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/ElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698