mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Auto merge of #8633 - rilut:remove-node-is-anchor-element, r=nox
Remove 'Node::is_anchor_element' Should fixes #8631. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8633) <!-- Reviewable:end -->
This commit is contained in:
commit
28582bb9f5
2 changed files with 3 additions and 7 deletions
|
@ -434,11 +434,6 @@ impl Node {
|
|||
self.children_count.get()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_anchor_element(&self) -> bool {
|
||||
self.type_id() == NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAnchorElement))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_doctype(&self) -> bool {
|
||||
self.type_id() == NodeTypeId::DocumentType
|
||||
|
|
|
@ -35,6 +35,7 @@ use dom::document::{Document, DocumentProgressHandler, IsHTMLDocument};
|
|||
use dom::document::{DocumentSource, MouseEventType};
|
||||
use dom::element::Element;
|
||||
use dom::event::{Event, EventBubbles, EventCancelable};
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::node::{Node, NodeDamage, window_from_node};
|
||||
use dom::servohtmlparser::{ParserContext, ServoHTMLParser};
|
||||
use dom::uievent::UIEvent;
|
||||
|
@ -1797,7 +1798,7 @@ impl ScriptTask {
|
|||
// Notify Constellation about anchors that are no longer mouse over targets.
|
||||
for target in &*prev_mouse_over_targets {
|
||||
if !mouse_over_targets.contains(target) {
|
||||
if target.upcast::<Node>().is_anchor_element() {
|
||||
if target.is::<HTMLAnchorElement>() {
|
||||
let event = ConstellationMsg::NodeStatus(None);
|
||||
let ConstellationChan(ref chan) = self.constellation_chan;
|
||||
chan.send(event).unwrap();
|
||||
|
@ -1808,7 +1809,7 @@ impl ScriptTask {
|
|||
|
||||
// Notify Constellation about the topmost anchor mouse over target.
|
||||
for target in &*mouse_over_targets {
|
||||
if target.upcast::<Node>().is_anchor_element() {
|
||||
if target.is::<HTMLAnchorElement>() {
|
||||
let status = target.get_attribute(&ns!(""), &atom!("href"))
|
||||
.and_then(|href| {
|
||||
let value = href.value();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue