script: Rename bounding_content_box to bounding_content_box_or_zero.

And make bounding_content_box preserve whether the element is rendered.
This commit is contained in:
Emilio Cobos Álvarez 2017-01-17 00:27:49 +01:00
parent 485fe874e8
commit bdd7cb9753
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
6 changed files with 11 additions and 8 deletions

View file

@ -544,7 +544,7 @@ impl Activatable for HTMLAnchorElement {
if let Some(element) = target.downcast::<Element>() {
if target.is::<HTMLImageElement>() && element.has_attribute(&local_name!("ismap")) {
let target_node = element.upcast::<Node>();
let rect = target_node.bounding_content_box();
let rect = target_node.bounding_content_box_or_zero();
ismap_suffix = Some(
format!("?{},{}", mouse_event.ClientX().to_f32().unwrap() - rect.origin.x.to_f32_px(),
mouse_event.ClientY().to_f32().unwrap() - rect.origin.y.to_f32_px())