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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLElement.cpp

Issue 2179273003: Implement spec-compliant HTMLElement.prototype.isContentEditable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved.
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 else if (equalIgnoringCase(enabled, "false")) 580 else if (equalIgnoringCase(enabled, "false"))
581 setAttribute(contenteditableAttr, "false"); 581 setAttribute(contenteditableAttr, "false");
582 else if (equalIgnoringCase(enabled, "plaintext-only")) 582 else if (equalIgnoringCase(enabled, "plaintext-only"))
583 setAttribute(contenteditableAttr, "plaintext-only"); 583 setAttribute(contenteditableAttr, "plaintext-only");
584 else if (equalIgnoringCase(enabled, "inherit")) 584 else if (equalIgnoringCase(enabled, "inherit"))
585 removeAttribute(contenteditableAttr); 585 removeAttribute(contenteditableAttr);
586 else 586 else
587 exceptionState.throwDOMException(SyntaxError, "The value provided ('" + enabled + "') is not one of 'true', 'false', 'plaintext-only', or 'inherit'."); 587 exceptionState.throwDOMException(SyntaxError, "The value provided ('" + enabled + "') is not one of 'true', 'false', 'plaintext-only', or 'inherit'.");
588 } 588 }
589 589
590 bool HTMLElement::isContentEditable() const 590 bool HTMLElement::isContentEditableForBinding() const
591 { 591 {
592 return blink::isContentEditable(*this); 592 return isEditingHost(*this) || isEditable(*this);
593 } 593 }
594 594
595 bool HTMLElement::draggable() const 595 bool HTMLElement::draggable() const
596 { 596 {
597 return equalIgnoringCase(getAttribute(draggableAttr), "true"); 597 return equalIgnoringCase(getAttribute(draggableAttr), "true");
598 } 598 }
599 599
600 void HTMLElement::setDraggable(bool value) 600 void HTMLElement::setDraggable(bool value)
601 { 601 {
602 setAttribute(draggableAttr, value ? "true" : "false"); 602 setAttribute(draggableAttr, value ? "true" : "false");
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 #ifndef NDEBUG 1109 #ifndef NDEBUG
1110 1110
1111 // For use in the debugger 1111 // For use in the debugger
1112 void dumpInnerHTML(blink::HTMLElement*); 1112 void dumpInnerHTML(blink::HTMLElement*);
1113 1113
1114 void dumpInnerHTML(blink::HTMLElement* element) 1114 void dumpInnerHTML(blink::HTMLElement* element)
1115 { 1115 {
1116 printf("%s\n", element->innerHTML().ascii().data()); 1116 printf("%s\n", element->innerHTML().ascii().data());
1117 } 1117 }
1118 #endif 1118 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698