servo: Merge #13028 - Implement HTMLDataElement#value (from ofekd:implement-data-value-attr); r=KiChjang
authorOfek <ofek@outlook.com>
Thu, 25 Aug 2016 12:48:06 -0500
changeset 339573 0a908d343078cd91dfe69724f3dec99609e99a7d
parent 339572 1f49006396296dfefbc76200e3c67372e6d588f9
child 339574 24fe39332dec9f935f3070ef5f1ac82f6204fe05
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersKiChjang
servo: Merge #13028 - Implement HTMLDataElement#value (from ofekd:implement-data-value-attr); r=KiChjang <!-- Please describe your changes on the following line: --> Implement HTMLDataElement#value --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #12966 <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 6beec195ed9f030126350dd50c9175e7afdddab6
servo/components/script/dom/htmldataelement.rs
servo/components/script/dom/webidls/HTMLDataElement.webidl
--- a/servo/components/script/dom/htmldataelement.rs
+++ b/servo/components/script/dom/htmldataelement.rs
@@ -1,13 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLDataElementBinding;
+use dom::bindings::codegen::Bindings::HTMLDataElementBinding::HTMLDataElementMethods;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
 use string_cache::Atom;
 
 #[dom_struct]
@@ -28,8 +29,16 @@ impl HTMLDataElement {
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLDataElement> {
         Node::reflect_node(box HTMLDataElement::new_inherited(localName, prefix, document),
                            document,
                            HTMLDataElementBinding::Wrap)
     }
 }
+
+impl HTMLDataElementMethods for HTMLDataElement {
+    // https://html.spec.whatwg.org/multipage/#dom-data-value
+    make_getter!(Value, "value");
+
+    // https://html.spec.whatwg.org/multipage/#dom-data-value
+    make_setter!(SetValue, "value");
+}
--- a/servo/components/script/dom/webidls/HTMLDataElement.webidl
+++ b/servo/components/script/dom/webidls/HTMLDataElement.webidl
@@ -1,8 +1,8 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // https://html.spec.whatwg.org/multipage/#htmldataelement
 interface HTMLDataElement : HTMLElement {
-  //         attribute DOMString value;
+           attribute DOMString value;
 };