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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 2607403002: Disallow setting invalid values for registered properties via CSSOM (Closed)
Patch Set: fix comments Created 3 years, 11 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) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 7 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 } 508 }
509 509
510 String CSSComputedStyleDeclaration::getPropertyShorthand(const String&) { 510 String CSSComputedStyleDeclaration::getPropertyShorthand(const String&) {
511 return ""; 511 return "";
512 } 512 }
513 513
514 bool CSSComputedStyleDeclaration::isPropertyImplicit(const String&) { 514 bool CSSComputedStyleDeclaration::isPropertyImplicit(const String&) {
515 return false; 515 return false;
516 } 516 }
517 517
518 void CSSComputedStyleDeclaration::setProperty(const String& name, 518 void CSSComputedStyleDeclaration::setProperty(const ExecutionContext*,
519 const String& name,
519 const String&, 520 const String&,
520 const String&, 521 const String&,
521 ExceptionState& exceptionState) { 522 ExceptionState& exceptionState) {
522 exceptionState.throwDOMException( 523 exceptionState.throwDOMException(
523 NoModificationAllowedError, 524 NoModificationAllowedError,
524 "These styles are computed, and therefore the '" + name + 525 "These styles are computed, and therefore the '" + name +
525 "' property is read-only."); 526 "' property is read-only.");
526 } 527 }
527 528
528 String CSSComputedStyleDeclaration::removeProperty( 529 String CSSComputedStyleDeclaration::removeProperty(
(...skipping 19 matching lines...) Expand all
548 String CSSComputedStyleDeclaration::getPropertyValueInternal( 549 String CSSComputedStyleDeclaration::getPropertyValueInternal(
549 CSSPropertyID propertyID) { 550 CSSPropertyID propertyID) {
550 return getPropertyValue(propertyID); 551 return getPropertyValue(propertyID);
551 } 552 }
552 553
553 void CSSComputedStyleDeclaration::setPropertyInternal( 554 void CSSComputedStyleDeclaration::setPropertyInternal(
554 CSSPropertyID id, 555 CSSPropertyID id,
555 const String&, 556 const String&,
556 const String&, 557 const String&,
557 bool, 558 bool,
559 const ExecutionContext*,
558 ExceptionState& exceptionState) { 560 ExceptionState& exceptionState) {
559 // TODO(leviw): This code is currently unreachable, but shouldn't be. 561 // TODO(leviw): This code is currently unreachable, but shouldn't be.
560 exceptionState.throwDOMException( 562 exceptionState.throwDOMException(
561 NoModificationAllowedError, 563 NoModificationAllowedError,
562 "These styles are computed, and therefore the '" + 564 "These styles are computed, and therefore the '" +
563 getPropertyNameString(id) + "' property is read-only."); 565 getPropertyNameString(id) + "' property is read-only.");
564 } 566 }
565 567
566 DEFINE_TRACE(CSSComputedStyleDeclaration) { 568 DEFINE_TRACE(CSSComputedStyleDeclaration) {
567 visitor->trace(m_node); 569 visitor->trace(m_node);
568 CSSStyleDeclaration::trace(visitor); 570 CSSStyleDeclaration::trace(visitor);
569 } 571 }
570 572
571 } // namespace blink 573 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698