aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-12-19 12:33:07 -0800
committerGitHub <noreply@github.com>2016-12-19 12:33:07 -0800
commit56f236724c5989c5b0e020e4f1c98feb63a4375f (patch)
tree5c821ff1423dd9aea6a76a0e750143fbeb329fa3 /components/script/dom
parentd05cae5072fae2b3469a69119365aca4220e3394 (diff)
parentfa912b01ea35c31fa53b7d17d1bb97a9e664accc (diff)
downloadservo-56f236724c5989c5b0e020e4f1c98feb63a4375f.tar.gz
servo-56f236724c5989c5b0e020e4f1c98feb63a4375f.zip
Auto merge of #14631 - ConnorGBrewster:datetime_fix, r=Ms2ger
Make datetime just reflect <!-- Please describe your changes on the following line: --> This just uses `make_getter!` for `datetime` rather than checking if `datetime` has data and falling back to the child data if `datetime` has no data. I reverted 2 of the test changes and added back an old test that makes sure that child content is not returned when `datetime` is empty. --- <!-- 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 #14611 (github issue number if applicable). <!-- 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. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14631) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/htmltimeelement.rs16
1 files changed, 1 insertions, 15 deletions
diff --git a/components/script/dom/htmltimeelement.rs b/components/script/dom/htmltimeelement.rs
index 84794443e02..c5286dd685f 100644
--- a/components/script/dom/htmltimeelement.rs
+++ b/components/script/dom/htmltimeelement.rs
@@ -2,14 +2,11 @@
* 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::ElementBinding::ElementBinding::ElementMethods;
use dom::bindings::codegen::Bindings::HTMLTimeElementBinding;
use dom::bindings::codegen::Bindings::HTMLTimeElementBinding::HTMLTimeElementMethods;
-use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
-use dom::element::Element;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use html5ever_atoms::LocalName;
@@ -38,18 +35,7 @@ impl HTMLTimeElement {
impl HTMLTimeElementMethods for HTMLTimeElement {
// https://html.spec.whatwg.org/multipage/#dom-time-datetime
- //make_getter!(DateTime, "datetime");
- fn DateTime(&self) -> DOMString {
- let element = self.upcast::<Element>();
- if element.has_attribute(&local_name!("datetime")) {
- return element.get_string_attribute(&local_name!("datetime"))
- } else {
- match element.GetInnerHTML() {
- Ok(x) => x,
- _ => DOMString::new(),
- }
- }
- }
+ make_getter!(DateTime, "datetime");
// https://html.spec.whatwg.org/multipage/#dom-time-datetime
make_setter!(SetDateTime, "datetime");