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

Implement Document.createElementNS() #1391

Closed
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b3aaa4b
Document.creatElementNS() and reftest
therealglazou Dec 12, 2013
6666929
merge upstream
therealglazou Feb 21, 2014
4f8acae
Merge remote-tracking branch 'upstream/master' into therealglazou/cre…
therealglazou Feb 21, 2014
28933b1
new version of Document.createElementNS
therealglazou Feb 21, 2014
9f0e696
De-@mut pipeline
larsbergstrom Feb 11, 2014
2ec9649
Shut down the profiler in headless compositing mode
pcwalton Feb 21, 2014
4fe305c
Prevent '&nbsp' from stripping as whitespace
june0cho Feb 21, 2014
26cd50d
Fix: whitespace is considered as spaces(U+0020), tabs(U+0009), and li…
june0cho Feb 21, 2014
735d826
De-@mut the FrameTree.
larsbergstrom Feb 14, 2014
d39f028
Update rust-layers submodule
larsbergstrom Feb 19, 2014
998a561
Remove commented-out parts of Document.webidl and HTMLDocument.webidl.
Ms2ger Feb 22, 2014
f345b69
Create a Line DisplayItem
ngsankha Feb 17, 2014
a8716ad
add Element::new
therealglazou Feb 24, 2014
b4d5184
trailing ws
therealglazou Feb 24, 2014
99f02d1
reuse get_attribute_parts
therealglazou Feb 24, 2014
d5a5fb6
no lowercasing for html element names
therealglazou Feb 24, 2014
0f764df
adding comment with spec URL
therealglazou Feb 24, 2014
77bd9b0
simplify match in CreateElementNS
therealglazou Feb 24, 2014
916c5d1
simplify match in CreateElementNS
therealglazou Feb 24, 2014
f1d60a7
simplify namespace error cases
therealglazou Feb 24, 2014
575c25e
simplify namespace error cases
therealglazou Feb 24, 2014
1308285
remove the ': Namesapce'
therealglazou Feb 24, 2014
3c28d06
better test
therealglazou Feb 24, 2014
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fix: whitespace is considered as spaces(U+0020), tabs(U+0009), and li…

…ne breaks(U+000D U+000A)
  • Loading branch information
june0cho authored and therealglazou committed Feb 24, 2014
commit 26cd50d1f6962725cd416246a617a15ea3f0feb2
@@ -22,7 +22,7 @@ use servo_util::geometry::Au;
use servo_util::geometry;
use servo_util::range::*;
use servo_util::namespace;
use servo_util::str::is_whitespace_not_nbsp;
use servo_util::str::is_whitespace;

use std::cast;
use std::cell::RefCell;
@@ -1429,7 +1429,7 @@ impl Box {
/// Returns true if this box is an unscanned text box that consists entirely of whitespace.
pub fn is_whitespace_only(&self) -> bool {
match self.specific {
UnscannedTextBox(ref text_box_info) => is_whitespace_not_nbsp(text_box_info.text),
UnscannedTextBox(ref text_box_info) => is_whitespace(text_box_info.text),
_ => false,
}
}
@@ -43,7 +43,7 @@ use style::ComputedValues;
use servo_util::namespace;
use servo_util::url::parse_url;
use servo_util::url::is_image_data;
use servo_util::str::is_whitespace_not_nbsp;
use servo_util::str::is_whitespace;

use extra::url::Url;
use extra::arc::Arc;
@@ -725,7 +725,7 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> {
match self.type_id() {
TextNodeTypeId => {
unsafe {
if !self.with_text(|text| is_whitespace_not_nbsp(text.characterdata.data)) {
if !self.with_text(|text| is_whitespace(text.characterdata.data)) {
return false
}

@@ -19,6 +19,9 @@ pub fn null_str_as_empty_ref<'a>(s: &'a Option<DOMString>) -> &'a str {
}
}

pub fn is_whitespace_not_nbsp(s: &str) -> bool {
s.chars().all(|c| c.is_whitespace() && c != '\xa0')
pub fn is_whitespace(s: &str) -> bool {
s.chars().all(|c| match c {
'\u0020' | '\u0009' | '\u000D' | '\u000A' => true,
_ => false
})
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.