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

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

Issue 245103004: Remove dead code from childIndex optimization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/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 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 // FIXME: Try to do better than this. Ensure that styleForElement() work s for elements that are not in the 2412 // FIXME: Try to do better than this. Ensure that styleForElement() work s for elements that are not in the
2413 // document tree and figure out when to destroy the computed style for s uch elements. 2413 // document tree and figure out when to destroy the computed style for s uch elements.
2414 return 0; 2414 return 0;
2415 2415
2416 ElementRareData& rareData = ensureElementRareData(); 2416 ElementRareData& rareData = ensureElementRareData();
2417 if (!rareData.computedStyle()) 2417 if (!rareData.computedStyle())
2418 rareData.setComputedStyle(document().styleForElementIgnoringPendingStyle sheets(this)); 2418 rareData.setComputedStyle(document().styleForElementIgnoringPendingStyle sheets(this));
2419 return pseudoElementSpecifier ? rareData.computedStyle()->getCachedPseudoSty le(pseudoElementSpecifier) : rareData.computedStyle(); 2419 return pseudoElementSpecifier ? rareData.computedStyle()->getCachedPseudoSty le(pseudoElementSpecifier) : rareData.computedStyle();
2420 } 2420 }
2421 2421
2422 void Element::setChildIndex(unsigned index)
2423 {
2424 ElementRareData& rareData = ensureElementRareData();
2425 if (RenderStyle* style = renderStyle())
2426 style->setUnique();
2427 rareData.setChildIndex(index);
2428 }
2429
2430 unsigned Element::rareDataChildIndex() const
2431 {
2432 ASSERT(hasRareData());
2433 return elementRareData()->childIndex();
2434 }
2435
2436 AtomicString Element::computeInheritedLanguage() const 2422 AtomicString Element::computeInheritedLanguage() const
2437 { 2423 {
2438 const Node* n = this; 2424 const Node* n = this;
2439 AtomicString value; 2425 AtomicString value;
2440 // The language property is inherited, so we iterate over the parents to fin d the first language. 2426 // The language property is inherited, so we iterate over the parents to fin d the first language.
2441 do { 2427 do {
2442 if (n->isElementNode()) { 2428 if (n->isElementNode()) {
2443 if (const ElementData* elementData = toElement(n)->elementData()) { 2429 if (const ElementData* elementData = toElement(n)->elementData()) {
2444 // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml 1/#C_7 2430 // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml 1/#C_7
2445 if (const Attribute* attribute = elementData->getAttributeItem(X MLNames::langAttr)) 2431 if (const Attribute* attribute = elementData->getAttributeItem(X MLNames::langAttr))
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
3276 || isHTMLObjectElement(*this) 3262 || isHTMLObjectElement(*this)
3277 || isHTMLAppletElement(*this) 3263 || isHTMLAppletElement(*this)
3278 || isHTMLCanvasElement(*this)) 3264 || isHTMLCanvasElement(*this))
3279 return false; 3265 return false;
3280 if (FullscreenElementStack::isActiveFullScreenElement(this)) 3266 if (FullscreenElementStack::isActiveFullScreenElement(this))
3281 return false; 3267 return false;
3282 return true; 3268 return true;
3283 } 3269 }
3284 3270
3285 } // namespace WebCore 3271 } // 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