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

Side by Side Diff: sky/engine/core/dom/Element.cpp

Issue 922893002: Merge the Sky Engine changes from the SkyDart branch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/core/dom/Document.idl ('k') | sky/engine/core/dom/Element.idl » ('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 11 matching lines...) Expand all
22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA. 23 * Boston, MA 02110-1301, USA.
24 */ 24 */
25 25
26 #include "sky/engine/config.h" 26 #include "sky/engine/config.h"
27 #include "sky/engine/core/dom/Element.h" 27 #include "sky/engine/core/dom/Element.h"
28 28
29 #include "gen/sky/core/CSSValueKeywords.h" 29 #include "gen/sky/core/CSSValueKeywords.h"
30 #include "gen/sky/core/HTMLNames.h" 30 #include "gen/sky/core/HTMLNames.h"
31 #include "gen/sky/platform/RuntimeEnabledFeatures.h" 31 #include "gen/sky/platform/RuntimeEnabledFeatures.h"
32 #include "sky/engine/bindings/core/v8/Dictionary.h" 32 #include "sky/engine/bindings2/exception_messages.h"
33 #include "sky/engine/bindings/core/v8/ExceptionMessages.h" 33 #include "sky/engine/bindings2/exception_state.h"
34 #include "sky/engine/bindings/core/v8/ExceptionState.h"
35 #include "sky/engine/core/animation/AnimationTimeline.h" 34 #include "sky/engine/core/animation/AnimationTimeline.h"
36 #include "sky/engine/core/animation/css/CSSAnimations.h" 35 #include "sky/engine/core/animation/css/CSSAnimations.h"
37 #include "sky/engine/core/css/CSSImageValue.h" 36 #include "sky/engine/core/css/CSSImageValue.h"
38 #include "sky/engine/core/css/CSSStyleSheet.h" 37 #include "sky/engine/core/css/CSSStyleSheet.h"
39 #include "sky/engine/core/css/CSSValuePool.h" 38 #include "sky/engine/core/css/CSSValuePool.h"
40 #include "sky/engine/core/css/PropertySetCSSStyleDeclaration.h" 39 #include "sky/engine/core/css/PropertySetCSSStyleDeclaration.h"
41 #include "sky/engine/core/css/StylePropertySet.h" 40 #include "sky/engine/core/css/StylePropertySet.h"
42 #include "sky/engine/core/css/parser/BisonCSSParser.h" 41 #include "sky/engine/core/css/parser/BisonCSSParser.h"
43 #include "sky/engine/core/css/resolver/StyleResolver.h" 42 #include "sky/engine/core/css/resolver/StyleResolver.h"
44 #include "sky/engine/core/dom/Attr.h" 43 #include "sky/engine/core/dom/Attr.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 { 260 {
262 if (equalIgnoringCase(enabled, "true")) 261 if (equalIgnoringCase(enabled, "true"))
263 setAttribute(HTMLNames::contenteditableAttr, "true"); 262 setAttribute(HTMLNames::contenteditableAttr, "true");
264 else if (equalIgnoringCase(enabled, "false")) 263 else if (equalIgnoringCase(enabled, "false"))
265 setAttribute(HTMLNames::contenteditableAttr, "false"); 264 setAttribute(HTMLNames::contenteditableAttr, "false");
266 else if (equalIgnoringCase(enabled, "plaintext-only")) 265 else if (equalIgnoringCase(enabled, "plaintext-only"))
267 setAttribute(HTMLNames::contenteditableAttr, "plaintext-only"); 266 setAttribute(HTMLNames::contenteditableAttr, "plaintext-only");
268 else if (equalIgnoringCase(enabled, "inherit")) 267 else if (equalIgnoringCase(enabled, "inherit"))
269 removeAttribute(HTMLNames::contenteditableAttr); 268 removeAttribute(HTMLNames::contenteditableAttr);
270 else 269 else
271 exceptionState.throwDOMException(SyntaxError, "The value provided ('" + enabled + "') is not one of 'true', 'false', 'plaintext-only', or 'inherit'."); 270 exceptionState.ThrowDOMException(SyntaxError, "The value provided ('" + enabled + "') is not one of 'true', 'false', 'plaintext-only', or 'inherit'.");
272 } 271 }
273 272
274 bool Element::spellcheck() const 273 bool Element::spellcheck() const
275 { 274 {
276 return isSpellCheckingEnabled(); 275 return isSpellCheckingEnabled();
277 } 276 }
278 277
279 void Element::setSpellcheck(bool enable) 278 void Element::setSpellcheck(bool enable)
280 { 279 {
281 setAttribute(HTMLNames::spellcheckAttr, enable ? "true" : "false"); 280 setAttribute(HTMLNames::spellcheckAttr, enable ? "true" : "false");
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 FloatRect result = quads[0].boundingBox(); 428 FloatRect result = quads[0].boundingBox();
430 for (size_t i = 1; i < quads.size(); ++i) 429 for (size_t i = 1; i < quads.size(); ++i)
431 result.unite(quads[i].boundingBox()); 430 result.unite(quads[i].boundingBox());
432 431
433 return ClientRect::create(result); 432 return ClientRect::create(result);
434 } 433 }
435 434
436 void Element::setAttribute(const AtomicString& localName, const AtomicString& va lue, ExceptionState& exceptionState) 435 void Element::setAttribute(const AtomicString& localName, const AtomicString& va lue, ExceptionState& exceptionState)
437 { 436 {
438 if (!Document::isValidName(localName)) { 437 if (!Document::isValidName(localName)) {
439 exceptionState.throwDOMException(InvalidCharacterError, "'" + localName + "' is not a valid attribute name."); 438 exceptionState.ThrowDOMException(InvalidCharacterError, "'" + localName + "' is not a valid attribute name.");
440 return; 439 return;
441 } 440 }
442 441
443 synchronizeAttribute(localName); 442 synchronizeAttribute(localName);
444 443
445 if (!elementData()) { 444 if (!elementData()) {
446 setAttributeInternal(kNotFound, QualifiedName(localName), value, NotInSy nchronizationOfLazyAttribute); 445 setAttributeInternal(kNotFound, QualifiedName(localName), value, NotInSy nchronizationOfLazyAttribute);
447 return; 446 return;
448 } 447 }
449 448
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 return false; 1586 return false;
1588 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) 1587 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue))
1589 return true; 1588 return true;
1590 // Host rules could also have effects. 1589 // Host rules could also have effects.
1591 if (ShadowRoot* shadowRoot = this->shadowRoot()) 1590 if (ShadowRoot* shadowRoot = this->shadowRoot())
1592 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue); 1591 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue);
1593 return false; 1592 return false;
1594 } 1593 }
1595 1594
1596 } // namespace blink 1595 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Document.idl ('k') | sky/engine/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698