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

Added current_line variable to track current line #14661

Closed
wants to merge 6 commits into from

Separated function into one that returns boolean and one that returns…

… line number.
  • Loading branch information
karenher committed Dec 25, 2016
commit a0fea2ef862b0cc1e0a3daefa906b4e0ae3d0e9c
@@ -148,7 +148,13 @@ pub enum ElementCreator {
}

impl ElementCreator {
pub fn is_parser_created(&self) -> u64 {
pub fn is_parser_created(&self) -> bool {
match *self {
ElementCreator::ParserCreated(l) => true,
ElementCreator::ScriptCreated => false,
}
}
pub fn return_line_number(&self) -> u64 {
match *self {
ElementCreator::ParserCreated(l) => l,
ElementCreator::ScriptCreated => 1,
@@ -70,7 +70,7 @@ impl HTMLLinkElement {
HTMLLinkElement {
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
rel_list: Default::default(),
parser_inserted: Cell::new(creator == ElementCreator::ParserCreated(1)),
parser_inserted: Cell::new(creator.is_parser_created()),
stylesheet: DOMRefCell::new(None),
cssom_stylesheet: MutNullableJS::new(None),
}
@@ -76,12 +76,12 @@ impl HTMLScriptElement {
htmlelement:
HTMLElement::new_inherited(local_name, prefix, document),
already_started: Cell::new(false),
parser_inserted: Cell::new(creator == ElementCreator::ParserCreated(1)),
non_blocking: Cell::new(creator != ElementCreator::ParserCreated(1)),
parser_inserted: Cell::new(creator.is_parser_created()),
non_blocking: Cell::new(!creator.is_parser_created()),
ready_to_be_parser_executed: Cell::new(false),

This comment has been minimized.

Copy link
@jdm

jdm Dec 25, 2016

Member

The checks for ParserCeated on the previous line (and elsewhere in this PR) are still incorrect.

parser_document: JS::from_ref(document),
load: DOMRefCell::new(None),
line_number: creator.is_parser_created(),
line_number: creator.return_line_number(),
}
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.