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

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

Issue 742353004: Implement computedRole and computedName (behind a flag) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move interfaces on to Element Created 6 years 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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 } 963 }
964 964
965 IntRect Element::screenRect() const 965 IntRect Element::screenRect() const
966 { 966 {
967 if (!renderer()) 967 if (!renderer())
968 return IntRect(); 968 return IntRect();
969 // FIXME: this should probably respect transforms 969 // FIXME: this should probably respect transforms
970 return document().view()->contentsToScreen(renderer()->absoluteBoundingBoxRe ctIgnoringTransforms()); 970 return document().view()->contentsToScreen(renderer()->absoluteBoundingBoxRe ctIgnoringTransforms());
971 } 971 }
972 972
973 const AtomicString& Element::computedRole()
974 {
975 document().updateLayoutIgnorePendingStylesheets();
976 ScopedAXObjectCache cache(document());
977 return cache->computedRoleForNode(this);
978 }
979
980 const String Element::computedName()
adamk 2014/12/16 01:54:48 ditto, no need for const here
aboxhall 2014/12/16 04:15:26 Done
981 {
982 document().updateLayoutIgnorePendingStylesheets();
983 ScopedAXObjectCache cache(document());
984 return cache->computedNameForNode(this);
985 }
986
973 const AtomicString& Element::getAttribute(const AtomicString& localName) const 987 const AtomicString& Element::getAttribute(const AtomicString& localName) const
974 { 988 {
975 if (!elementData()) 989 if (!elementData())
976 return nullAtom; 990 return nullAtom;
977 synchronizeAttribute(localName); 991 synchronizeAttribute(localName);
978 if (const Attribute* attribute = elementData()->attributes().find(localName, shouldIgnoreAttributeCase())) 992 if (const Attribute* attribute = elementData()->attributes().find(localName, shouldIgnoreAttributeCase()))
979 return attribute->value(); 993 return attribute->value();
980 return nullAtom; 994 return nullAtom;
981 } 995 }
982 996
(...skipping 2423 matching lines...) Expand 10 before | Expand all | Expand 10 after
3406 return wrapper; 3420 return wrapper;
3407 3421
3408 CustomElementBinding* binding = perContextData->customElementBinding(customE lementDefinition()); 3422 CustomElementBinding* binding = perContextData->customElementBinding(customE lementDefinition());
3409 3423
3410 wrapper->SetPrototype(binding->prototype()); 3424 wrapper->SetPrototype(binding->prototype());
3411 3425
3412 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType, wrapper); 3426 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType, wrapper);
3413 } 3427 }
3414 3428
3415 } // namespace blink 3429 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698