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

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

Issue 1898403002: [WIP] Implement :dir() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase... other changes too probably Created 4 years, 7 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 3622 matching lines...) Expand 10 before | Expand all | Expand 10 after
3633 // Investigate cases where we share styles to optimize styling performance. 3633 // Investigate cases where we share styles to optimize styling performance.
3634 if (isChildOfV1ShadowHost()) 3634 if (isChildOfV1ShadowHost())
3635 return false; 3635 return false;
3636 if (hasAnimations()) 3636 if (hasAnimations())
3637 return false; 3637 return false;
3638 if (Fullscreen::isActiveFullScreenElement(*this)) 3638 if (Fullscreen::isActiveFullScreenElement(*this))
3639 return false; 3639 return false;
3640 return true; 3640 return true;
3641 } 3641 }
3642 3642
3643 TextDirection Element::directionality() const
3644 {
3645 if (isHTMLElement() && toHTMLElement(this)->hasDirectionAuto()) {
3646 CachedTextDirection direction = const_cast<Element*>(this)->ensureUnique ElementData().directionality();
3647 if (direction == CachedTextDirection::NotAutoOrNotCached) {
3648 toHTMLElement(this)->cacheDirectionalityForDirAuto();
3649 direction = elementData()->directionality();
3650 DCHECK(direction != CachedTextDirection::NotAutoOrNotCached);
3651 }
3652 if (direction == CachedTextDirection::AutoLTR)
3653 return LTR;
3654 return RTL;
3655 }
3656
3657 if (equalIgnoringCase(fastGetAttribute(dirAttr), "ltr"))
3658 return LTR;
3659 if (equalIgnoringCase(fastGetAttribute(dirAttr), "rtl"))
3660 return RTL;
3661
3662 const Element* parent = FlatTreeTraversal::parentElement(*this);
3663 if (parent)
3664 return parent->directionality();
3665 return LTR;
3666 }
3667
3643 void Element::logAddElementIfIsolatedWorldAndInDocument(const char element[], co nst QualifiedName& attr1) 3668 void Element::logAddElementIfIsolatedWorldAndInDocument(const char element[], co nst QualifiedName& attr1)
3644 { 3669 {
3645 if (!inShadowIncludingDocument()) 3670 if (!inShadowIncludingDocument())
3646 return; 3671 return;
3647 V8DOMActivityLogger* activityLogger = V8DOMActivityLogger::currentActivityLo ggerIfIsolatedWorld(); 3672 V8DOMActivityLogger* activityLogger = V8DOMActivityLogger::currentActivityLo ggerIfIsolatedWorld();
3648 if (!activityLogger) 3673 if (!activityLogger)
3649 return; 3674 return;
3650 Vector<String, 2> argv; 3675 Vector<String, 2> argv;
3651 argv.append(element); 3676 argv.append(element);
3652 argv.append(fastGetAttribute(attr1)); 3677 argv.append(fastGetAttribute(attr1));
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
3699 3724
3700 DEFINE_TRACE(Element) 3725 DEFINE_TRACE(Element)
3701 { 3726 {
3702 if (hasRareData()) 3727 if (hasRareData())
3703 visitor->trace(elementRareData()); 3728 visitor->trace(elementRareData());
3704 visitor->trace(m_elementData); 3729 visitor->trace(m_elementData);
3705 ContainerNode::trace(visitor); 3730 ContainerNode::trace(visitor);
3706 } 3731 }
3707 3732
3708 } // namespace blink 3733 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698