Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc cleanup for DOM attributes #8404

Merged
merged 4 commits into from Nov 9, 2015
Merged

Conversation

@eefriedman
Copy link
Contributor

eefriedman commented Nov 8, 2015

No functional change; just cleanups related to parsing attributes.

Review on Reviewable

@highfive
Copy link

highfive commented Nov 8, 2015

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
@nox nox self-assigned this Nov 8, 2015
@nox
Copy link
Member

nox commented Nov 8, 2015

A minor nit, otherwise LGTM.

-S-awaiting-review +S-needs-code-changes


Reviewed 2 of 2 files at r1, 1 of 1 files at r2, 4 of 4 files at r3, 2 of 2 files at r4.
Review status: all files reviewed at latest revision, 9 unresolved discussions.


components/script/dom/htmlbodyelement.rs, line 100 [r3] (raw file):
I'm pretty sure the & is superfluous.


components/script/dom/htmlbodyelement.rs, line 110 [r3] (raw file):
Ditto.


components/script/dom/htmlbodyelement.rs, line 120 [r3] (raw file):
Ditto.


components/script/dom/htmlfontelement.rs, line 94 [r3] (raw file):
Ditto.


components/script/dom/htmlfontelement.rs, line 104 [r3] (raw file):
Ditto.


components/script/dom/htmlfontelement.rs, line 114 [r3] (raw file):
Ditto.


components/script/dom/htmliframeelement.rs, line 208 [r3] (raw file):
Ditto.


components/script/dom/htmliframeelement.rs, line 210 [r3] (raw file):
We should probably file a followup to make this a variant of AttrValue too.


components/script/dom/htmliframeelement.rs, line 218 [r3] (raw file):
Ditto.


Comments from the review on Reviewable.io

@eefriedman
Copy link
Contributor Author

eefriedman commented Nov 8, 2015

Review status: 1 of 6 files reviewed at latest revision, 9 unresolved discussions.


components/script/dom/htmliframeelement.rs, line 210 [r3] (raw file):
Sure; I'll file it.


Comments from the review on Reviewable.io

@eefriedman
Copy link
Contributor Author

eefriedman commented Nov 8, 2015

@bors-servo r=nox

@bors-servo
Copy link
Contributor

bors-servo commented Nov 8, 2015

📌 Commit c38856d has been approved by nox

@bors-servo
Copy link
Contributor

bors-servo commented Nov 8, 2015

Testing commit c38856d with merge 928aba0...

bors-servo added a commit that referenced this pull request Nov 8, 2015
Misc cleanup for DOM attributes

No functional change; just cleanups related to parsing attributes.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8404)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 8, 2015

💔 Test failed - mac-rel-wpt

@frewsxcv
Copy link
Member

frewsxcv commented Nov 8, 2015

Fail seems legit

  ▶ TIMEOUT [expected OK] /html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-02.html
  │ 
  │ thread 'LayoutWorker worker 1/6' panicked at 'Color not found', /Users/servo/buildbot/slave/mac-rel-wpt/build/components/script/dom/attr.rs:118
  │ stack backtrace:
  │    1:        0x10b7f9b48 - sys::backtrace::tracing::imp::write::h662793599f713c74T5s
  │    2:        0x10b7fb63f - panicking::log_panic::_<closure>::closure.38923
  │    3:        0x10b7fb0e9 - panicking::log_panic::h87af6096e0b6fa7c4Uw
  │    4:        0x10b7e9dd6 - sys_common::unwind::begin_unwind_inner::h1e338bc64cf56d9dr8r
  │    5:        0x10a4c0924 - sys_common::unwind::begin_unwind::begin_unwind::h11769312394538122404
  │    6:        0x10a7fe5fc - dom::htmlbodyelement::_<impl>::get_background_color::h96cce9c616bb54e5ktw
  │    7:        0x10a4ae39a - css::matching::_<impl>::match_element::h823c88ff0903b64c9Hz
  │    8:        0x10a493160 - traversal::_<impl>::process::h3858f81d9981cb5bvYx
  │    9:        0x10a492821 - parallel::_<impl>::run_parallel::h13d7b06c0342da40aet
  │   10:        0x10a493d7e - parallel::recalc_style::h5edbc18b903df6bcAet
  │   11:        0x10a43113e - boxed::_<impl>::call_box::call_box::h11765958047692383731
  │   12:        0x10a40d5c2 - sys_common::unwind::try::try_fn::try_fn::h6634675915793128526
  │   13:        0x10b7f9018 - __rust_try
  │   14:        0x10b7f64be - sys_common::unwind::try::inner_try::hc13d8e198528cd0fZ4r
  │   15:        0x10a40d767 - boxed::_<impl>::call_box::call_box::h5255149473090508000
  │   16:        0x10b7faa0d - sys::thread::_<impl>::new::thread_start::h906ddce3a93d4852ksw
  │   17:     0x7fff8416a059 - _pthread_body
  └   18:     0x7fff84169fd6 - _pthread_start
match name {
&atom!("text") => AttrValue::from_legacy_color(value),
match *name {
atom!("bgcolor") |

This comment has been minimized.

Copy link
@frewsxcv

frewsxcv Nov 8, 2015

Member

Should this be bgColor?

fn get_background_color(&self) -> Option<RGBA> {
unsafe {
(&*self.upcast::<Element>().unsafe_get())
.get_attr_for_layout(&ns!(""), &atom!("bgcolor"))

This comment has been minimized.

Copy link
@frewsxcv

frewsxcv Nov 8, 2015

Member

Should this be bgColor?

I actually don't know, just pointing out one of these might be capitalized

This comment has been minimized.

Copy link
@eefriedman

eefriedman Nov 8, 2015

Author Contributor

HTML attributes are all lower-case; bgcolor is correct.

(I tracked down the reason for the test failure; it actually isn't a mistake in htmlbodyelement.rs.)

@eefriedman eefriedman force-pushed the eefriedman:misc-attributes branch from c38856d to 224fb63 Nov 8, 2015
@eefriedman
Copy link
Contributor Author

eefriedman commented Nov 8, 2015

@nox Updated with a fix for document.rs ; please double-check that the change makes sense.

@bors-servo
Copy link
Contributor

bors-servo commented Nov 9, 2015

The latest upstream changes (presumably #8419) made this pull request unmergeable. Please resolve the merge conflicts.

@eefriedman eefriedman force-pushed the eefriedman:misc-attributes branch from 224fb63 to bee81d9 Nov 9, 2015
@nox
Copy link
Member

nox commented Nov 9, 2015

-S-awaiting-review +S-needs-code-changes +S-needs-rebase


Reviewed 1 of 2 files at r1, 1 of 1 files at r2, 4 of 4 files at r3, 2 of 2 files at r4, 3 of 3 files at r5, 1 of 1 files at r6, 2 of 2 files at r7.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


components/script/dom/htmlbodyelement.rs, line 100 [r3] (raw file):
You forgot that one.


Comments from the review on Reviewable.io

@eefriedman eefriedman force-pushed the eefriedman:misc-attributes branch from bee81d9 to af78173 Nov 9, 2015
@eefriedman
Copy link
Contributor Author

eefriedman commented Nov 9, 2015

@bors-servo r=nox

@bors-servo
Copy link
Contributor

bors-servo commented Nov 9, 2015

📌 Commit af78173 has been approved by nox

@bors-servo
Copy link
Contributor

bors-servo commented Nov 9, 2015

Testing commit af78173 with merge d8df028...

bors-servo added a commit that referenced this pull request Nov 9, 2015
Misc cleanup for DOM attributes

No functional change; just cleanups related to parsing attributes.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8404)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 9, 2015

💔 Test failed - gonk

@eefriedman
Copy link
Contributor Author

eefriedman commented Nov 9, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Nov 9, 2015

Previous build results for android, mac-dev-ref-unit are reusable. Rebuilding only gonk, linux-dev, linux-rel, mac-rel-css, mac-rel-wpt...

@bors-servo
Copy link
Contributor

bors-servo commented Nov 9, 2015

@bors-servo bors-servo merged commit af78173 into servo:master Nov 9, 2015
2 of 3 checks passed
2 of 3 checks passed
code-review/reviewable Review in progress: 6 of 7 files reviewed, 3 unresolved discussions
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.