зеркало из https://github.com/mozilla/gecko-dev.git
merge autoland to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 6lQbMSMbLfu
This commit is contained in:
Коммит
d818a4d165
|
@ -122,3 +122,7 @@ lextab.py
|
|||
|
||||
# tup database
|
||||
/.tup
|
||||
|
||||
# Ignore Visual Studio Code workspace files.
|
||||
.vscode/
|
||||
!.vscode/extensions.json
|
||||
|
|
|
@ -137,5 +137,7 @@ GPATH
|
|||
# tup database
|
||||
^\.tup
|
||||
|
||||
subinclude:servo/.hgignore
|
||||
# Ignore Visual Studio Code workspace files.
|
||||
\.vscode/(?!extensions.json$)
|
||||
|
||||
subinclude:servo/.hgignore
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
// Trim only touched lines.
|
||||
"NathanRidley.autotrim",
|
||||
// JS Babel ES6/ES7 syntax hilight.
|
||||
"dzannotti.vscode-babel-coloring",
|
||||
// ESLint support.
|
||||
"dbaeumer.vscode-eslint",
|
||||
// C/C++ language support.
|
||||
"ms-vscode.cpptools",
|
||||
// Rust language support.
|
||||
"kalitaalexey.vscode-rust",
|
||||
// CSS support for HTML documents.
|
||||
"ecmel.vscode-html-css"
|
||||
]
|
||||
}
|
|
@ -18,6 +18,11 @@ if (AppConstants.E10S_TESTING_ONLY) {
|
|||
"resource://gre/modules/UpdateUtils.jsm");
|
||||
}
|
||||
|
||||
if (AppConstants.MOZ_DEV_EDITION) {
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts",
|
||||
"resource://gre/modules/FxAccounts.jsm");
|
||||
}
|
||||
|
||||
var gMainPane = {
|
||||
/**
|
||||
* Initialization of this.
|
||||
|
@ -113,6 +118,10 @@ var gMainPane = {
|
|||
|
||||
OS.File.stat(ignoreSeparateProfile).then(() => separateProfileModeCheckbox.checked = false,
|
||||
() => separateProfileModeCheckbox.checked = true);
|
||||
|
||||
fxAccounts.getSignedInUser().then(data => {
|
||||
document.getElementById("getStarted").selectedIndex = data ? 1 : 0;
|
||||
});
|
||||
}
|
||||
|
||||
// Notify observers that the UI is now ready
|
||||
|
@ -210,10 +219,17 @@ var gMainPane = {
|
|||
.getService(Ci.nsIWindowMediator);
|
||||
let win = wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
if (win) {
|
||||
let accountsTab = win.gBrowser.addTab("about:accounts?action=signin&entrypoint=dev-edition-setup");
|
||||
win.gBrowser.selectedTab = accountsTab;
|
||||
}
|
||||
fxAccounts.getSignedInUser().then(data => {
|
||||
if (win) {
|
||||
if (data) {
|
||||
// We have a user, open Sync preferences in the same tab
|
||||
win.openUILinkIn("about:preferences#sync", "current");
|
||||
return;
|
||||
}
|
||||
let accountsTab = win.gBrowser.addTab("about:accounts?action=signin&entrypoint=dev-edition-setup");
|
||||
win.gBrowser.selectedTab = accountsTab;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -130,7 +130,10 @@
|
|||
label="&separateProfileMode.label;"/>
|
||||
<hbox align="center" class="indent">
|
||||
<label id="useFirefoxSync">&useFirefoxSync.label;</label>
|
||||
<label id="getStarted" class="text-link">&getStarted.label;</label>
|
||||
<deck id="getStarted">
|
||||
<label class="text-link">&getStarted.notloggedin.label;</label>
|
||||
<label class="text-link">&getStarted.configured.label;</label>
|
||||
</deck>
|
||||
</hbox>
|
||||
</vbox>
|
||||
#endif
|
||||
|
|
|
@ -18,9 +18,15 @@ if (AppConstants.E10S_TESTING_ONLY) {
|
|||
XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
|
||||
"resource://gre/modules/UpdateUtils.jsm");
|
||||
}
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
||||
"resource://gre/modules/PlacesUtils.jsm");
|
||||
|
||||
if (AppConstants.MOZ_DEV_EDITION) {
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts",
|
||||
"resource://gre/modules/FxAccounts.jsm");
|
||||
}
|
||||
|
||||
const ENGINE_FLAVOR = "text/x-moz-search-engine";
|
||||
|
||||
var gEngineView = null;
|
||||
|
@ -185,6 +191,11 @@ var gMainPane = {
|
|||
|
||||
OS.File.stat(ignoreSeparateProfile).then(() => separateProfileModeCheckbox.checked = false,
|
||||
() => separateProfileModeCheckbox.checked = true);
|
||||
|
||||
fxAccounts.getSignedInUser().then(data => {
|
||||
document.getElementById("getStarted").selectedIndex = data ? 1 : 0;
|
||||
})
|
||||
.catch(Cu.reportError);
|
||||
}
|
||||
|
||||
// Notify observers that the UI is now ready
|
||||
|
@ -282,10 +293,17 @@ var gMainPane = {
|
|||
.getService(Ci.nsIWindowMediator);
|
||||
let win = wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
if (win) {
|
||||
let accountsTab = win.gBrowser.addTab("about:accounts?action=signin&entrypoint=dev-edition-setup");
|
||||
win.gBrowser.selectedTab = accountsTab;
|
||||
}
|
||||
fxAccounts.getSignedInUser().then(data => {
|
||||
if (win) {
|
||||
if (data) {
|
||||
// We have a user, open Sync preferences in the same tab
|
||||
win.openUILinkIn("about:preferences#sync", "current");
|
||||
return;
|
||||
}
|
||||
let accountsTab = win.gBrowser.addTab("about:accounts?action=signin&entrypoint=dev-edition-setup");
|
||||
win.gBrowser.selectedTab = accountsTab;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -202,7 +202,10 @@
|
|||
label="&separateProfileMode.label;"/>
|
||||
<hbox align="center" class="indent">
|
||||
<label id="useFirefoxSync">&useFirefoxSync.label;</label>
|
||||
<label id="getStarted" class="text-link">&getStarted.label;</label>
|
||||
<deck id="getStarted">
|
||||
<label class="text-link">&getStarted.notloggedin.label;</label>
|
||||
<label class="text-link">&getStarted.configured.label;</label>
|
||||
</deck>
|
||||
</hbox>
|
||||
</vbox>
|
||||
#endif
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
<!ENTITY separateProfileMode.label "Allow &brandShortName; and Firefox to run at the same time">
|
||||
<!ENTITY useFirefoxSync.label "Tip: This uses separate profiles. Use Sync to share data between them.">
|
||||
<!ENTITY getStarted.label "Start using Sync…">
|
||||
<!ENTITY getStarted.notloggedin.label "Sign in to &syncBrand.shortName.label;…">
|
||||
<!ENTITY getStarted.configured.label "Open &syncBrand.shortName.label; preferences">
|
||||
|
||||
<!ENTITY e10sEnabled.label "Enable multi-process &brandShortName;">
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
<!ENTITY separateProfileMode.label "Allow &brandShortName; and Firefox to run at the same time">
|
||||
<!ENTITY useFirefoxSync.label "Tip: This uses separate profiles. Use Sync to share data between them.">
|
||||
<!ENTITY getStarted.label "Start using Sync…">
|
||||
<!ENTITY getStarted.notloggedin.label "Sign in to &syncBrand.shortName.label;…">
|
||||
<!ENTITY getStarted.configured.label "Open &syncBrand.shortName.label; preferences">
|
||||
|
||||
<!ENTITY e10sEnabled.label "Enable multi-process &brandShortName;">
|
||||
|
|
|
@ -302,13 +302,7 @@ window:not([chromehidden~="toolbar"]) #urlbar-wrapper > #urlbar:-moz-locale-dir(
|
|||
}
|
||||
|
||||
.tab-throbber[selected][progress] {
|
||||
list-style-image: url("chrome://browser/skin/compacttheme/loading-inverted.png");
|
||||
}
|
||||
|
||||
@media (min-resolution: 1.1dppx) {
|
||||
.tab-throbber[selected][progress] {
|
||||
list-style-image: url("chrome://browser/skin/compacttheme/loading-inverted@2x.png");
|
||||
}
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.tab-icon-sound[soundplaying],
|
||||
|
|
Двоичные данные
browser/themes/shared/compacttheme/loading-inverted.png
Двоичные данные
browser/themes/shared/compacttheme/loading-inverted.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 6.2 KiB |
Двоичные данные
browser/themes/shared/compacttheme/loading-inverted@2x.png
Двоичные данные
browser/themes/shared/compacttheme/loading-inverted@2x.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 16 KiB |
|
@ -140,8 +140,6 @@
|
|||
skin/classic/browser/privatebrowsing/private-browsing.svg (../shared/privatebrowsing/private-browsing.svg)
|
||||
skin/classic/browser/privatebrowsing/tracking-protection-off.svg (../shared/privatebrowsing/tracking-protection-off.svg)
|
||||
skin/classic/browser/privatebrowsing/tracking-protection.svg (../shared/privatebrowsing/tracking-protection.svg)
|
||||
skin/classic/browser/compacttheme/loading-inverted.png (../shared/compacttheme/loading-inverted.png)
|
||||
skin/classic/browser/compacttheme/loading-inverted@2x.png (../shared/compacttheme/loading-inverted@2x.png)
|
||||
skin/classic/browser/compacttheme/urlbar-history-dropmarker.svg (../shared/compacttheme/urlbar-history-dropmarker.svg)
|
||||
skin/classic/browser/urlbar-star.svg (../shared/urlbar-star.svg)
|
||||
skin/classic/browser/urlbar-tab.svg (../shared/urlbar-tab.svg)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
</mask>
|
||||
</defs>
|
||||
|
||||
<path fill="#0077ff" fill-opacity=".15" d="M8,0A8,8,0,0,0,0,8a8,8,0,0,0,8,8,8,8,0,0,0,8-8A8,8,0,0,0,8,0ZM8,13A5,5,0,0,1,3,8,5,5,0,0,1,8,3a5,5,0,0,1,5,5A5,5,0,0,1,8,13Z"/>
|
||||
<path mask="url(#myMask)" fill="#0090ff" d="M8,3a5,5,0,0,1,5,5h0a1.5,1.5,0,0,0,3,0h0a8,8,0,1,0-.8,3.5l-2.7-1.3A5,5,0,1,1,8,3Z"/>
|
||||
<path fill="context-fill" fill-opacity=".15" d="M8,0A8,8,0,0,0,0,8a8,8,0,0,0,8,8,8,8,0,0,0,8-8A8,8,0,0,0,8,0ZM8,13A5,5,0,0,1,3,8,5,5,0,0,1,8,3a5,5,0,0,1,5,5A5,5,0,0,1,8,13Z"/>
|
||||
<path mask="url(#myMask)" fill="context-fill" d="M8,3a5,5,0,0,1,5,5h0a1.5,1.5,0,0,0,3,0h0a8,8,0,1,0-.8,3.5l-2.7-1.3A5,5,0,1,1,8,3Z"/>
|
||||
|
||||
</svg>
|
||||
|
|
До Ширина: | Высота: | Размер: 932 B После Ширина: | Высота: | Размер: 942 B |
|
@ -206,6 +206,7 @@
|
|||
list-style-image: url("chrome://browser/skin/tabbrowser/loading.svg");
|
||||
animation-duration: 800ms;
|
||||
animation-name: tab-throbber-loading;
|
||||
fill: #0077ff;
|
||||
}
|
||||
|
||||
.tab-label {
|
||||
|
|
|
@ -5767,44 +5767,55 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
|
|||
const nsStyleDisplay* display = aStyleContext->StyleDisplay();
|
||||
RefPtr<nsStyleContext> styleContext(aStyleContext);
|
||||
PendingBinding* pendingBinding = nullptr;
|
||||
if ((aFlags & ITEM_ALLOW_XBL_BASE) && display->mBinding)
|
||||
{
|
||||
// Ensure that our XBL bindings are installed.
|
||||
if (aFlags & ITEM_ALLOW_XBL_BASE) {
|
||||
if (display->mBinding) {
|
||||
// Ensure that our XBL bindings are installed.
|
||||
|
||||
nsXBLService* xblService = nsXBLService::GetInstance();
|
||||
if (!xblService)
|
||||
return;
|
||||
nsXBLService* xblService = nsXBLService::GetInstance();
|
||||
if (!xblService)
|
||||
return;
|
||||
|
||||
bool resolveStyle;
|
||||
bool resolveStyle;
|
||||
|
||||
nsAutoPtr<PendingBinding> newPendingBinding(new PendingBinding());
|
||||
nsAutoPtr<PendingBinding> newPendingBinding(new PendingBinding());
|
||||
|
||||
nsresult rv = xblService->LoadBindings(aContent, display->mBinding->GetURI(),
|
||||
display->mBinding->mOriginPrincipal,
|
||||
getter_AddRefs(newPendingBinding->mBinding),
|
||||
&resolveStyle);
|
||||
if (NS_FAILED(rv) && rv != NS_ERROR_XBL_BLOCKED)
|
||||
return;
|
||||
nsresult rv = xblService->LoadBindings(aContent, display->mBinding->GetURI(),
|
||||
display->mBinding->mOriginPrincipal,
|
||||
getter_AddRefs(newPendingBinding->mBinding),
|
||||
&resolveStyle);
|
||||
if (NS_FAILED(rv) && rv != NS_ERROR_XBL_BLOCKED)
|
||||
return;
|
||||
|
||||
if (newPendingBinding->mBinding) {
|
||||
pendingBinding = newPendingBinding;
|
||||
// aState takes over owning newPendingBinding
|
||||
aState.AddPendingBinding(newPendingBinding.forget());
|
||||
if (newPendingBinding->mBinding) {
|
||||
pendingBinding = newPendingBinding;
|
||||
// aState takes over owning newPendingBinding
|
||||
aState.AddPendingBinding(newPendingBinding.forget());
|
||||
}
|
||||
|
||||
if (aContent->IsStyledByServo()) {
|
||||
NS_WARNING("stylo: Skipping Unsupported binding re-resolve. This needs fixing.");
|
||||
resolveStyle = false;
|
||||
}
|
||||
|
||||
if (resolveStyle) {
|
||||
styleContext =
|
||||
ResolveStyleContext(styleContext->GetParent(), aContent, &aState);
|
||||
display = styleContext->StyleDisplay();
|
||||
aStyleContext = styleContext;
|
||||
}
|
||||
|
||||
aTag = mDocument->BindingManager()->ResolveTag(aContent, &aNameSpaceID);
|
||||
} else if (display->mBinding.ForceGet()) {
|
||||
if (aContent->IsStyledByServo()) {
|
||||
// Servo's should_traverse_children skips styling descendants of
|
||||
// elements with a -moz-binding value. For -moz-binding URLs that can
|
||||
// be resolved, we will load the binding above, which will style the
|
||||
// children after they have been rearranged in the flattened tree.
|
||||
// If the URL couldn't be resolved, we still need to style the children,
|
||||
// so we do that here.
|
||||
mPresShell->StyleSet()->AsServo()->StyleNewChildren(aContent->AsElement());
|
||||
}
|
||||
}
|
||||
|
||||
if (aContent->IsStyledByServo()) {
|
||||
NS_WARNING("stylo: Skipping Unsupported binding re-resolve. This needs fixing.");
|
||||
resolveStyle = false;
|
||||
}
|
||||
|
||||
if (resolveStyle) {
|
||||
styleContext =
|
||||
ResolveStyleContext(styleContext->GetParent(), aContent, &aState);
|
||||
display = styleContext->StyleDisplay();
|
||||
aStyleContext = styleContext;
|
||||
}
|
||||
|
||||
aTag = mDocument->BindingManager()->ResolveTag(aContent, &aNameSpaceID);
|
||||
}
|
||||
|
||||
bool isGeneratedContent = ((aFlags & ITEM_IS_GENERATED_CONTENT) != 0);
|
||||
|
|
|
@ -1836,7 +1836,7 @@ fails == 992447.html 992447.html
|
|||
== 1021564-4.html 1021564-4.html
|
||||
pref(browser.display.use_document_fonts,0) == 1022481-1.html 1022481-1.html
|
||||
== 1022612-1.html 1022612-1.html
|
||||
== 1024473-1.html 1024473-1.html
|
||||
fuzzy-if(stylo,1,244) == 1024473-1.html 1024473-1.html
|
||||
== 1025914-1.html 1025914-1.html
|
||||
== 1042104-1.html 1042104-1.html
|
||||
== 1043537-1.html 1043537-1.html
|
||||
|
|
|
@ -2289,7 +2289,7 @@ dependencies = [
|
|||
"webrender_traits 0.27.0 (git+https://github.com/servo/webrender)",
|
||||
"webvr 0.0.1",
|
||||
"webvr_traits 0.0.1",
|
||||
"xml5ever 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"xml5ever 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3274,7 +3274,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "xml5ever"
|
||||
version = "0.4.2"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"html5ever-atoms 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3547,4 +3547,4 @@ dependencies = [
|
|||
"checksum xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a66b7c2281ebde13cf4391d70d4c7e5946c3c25e72a7b859ca8f677dcd0b0c61"
|
||||
"checksum xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12ea8eda4b1eb72f02d148402e23832d56a33f55d8c1b2d5bcdde91d79d47cb1"
|
||||
"checksum xml-rs 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b15eed12692bd59d15e98ee7f8dc8408465b992d8ddb4d1672c24865132ec7"
|
||||
"checksum xml5ever 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "236e16db2a9c6ddacc51731121e76431838c72d08b411603da37e1ee91c6d770"
|
||||
"checksum xml5ever 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b96d39141ee1af5889a0bfe871ef28937e617145ad63d41b2832c5b6752cbc5c"
|
||||
|
|
|
@ -51,7 +51,7 @@ use style::computed_values::content::ContentItem;
|
|||
use style::computed_values::position;
|
||||
use style::context::SharedStyleContext;
|
||||
use style::logical_geometry::Direction;
|
||||
use style::properties::{self, ServoComputedValues};
|
||||
use style::properties::ServoComputedValues;
|
||||
use style::selector_parser::{PseudoElement, RestyleDamage};
|
||||
use style::servo::restyle_damage::{BUBBLE_ISIZES, RECONSTRUCT_FLOW};
|
||||
use style::values::Either;
|
||||
|
@ -178,7 +178,7 @@ impl InlineBlockSplit {
|
|||
predecessors: mem::replace(
|
||||
fragment_accumulator,
|
||||
InlineFragmentsAccumulator::from_inline_node(
|
||||
node, style_context)).to_intermediate_inline_fragments(),
|
||||
node, style_context)).to_intermediate_inline_fragments(style_context),
|
||||
flow: flow,
|
||||
};
|
||||
|
||||
|
@ -273,7 +273,8 @@ impl InlineFragmentsAccumulator {
|
|||
self.fragments.absolute_descendants.push_descendants(fragments.absolute_descendants);
|
||||
}
|
||||
|
||||
fn to_intermediate_inline_fragments(self) -> IntermediateInlineFragments {
|
||||
fn to_intermediate_inline_fragments(self, context: &SharedStyleContext)
|
||||
-> IntermediateInlineFragments {
|
||||
let InlineFragmentsAccumulator {
|
||||
mut fragments,
|
||||
enclosing_node,
|
||||
|
@ -299,9 +300,9 @@ impl InlineFragmentsAccumulator {
|
|||
|
||||
if let Some((start, end)) = bidi_control_chars {
|
||||
fragments.fragments.push_front(
|
||||
control_chars_to_fragment(&enclosing_node, start, restyle_damage));
|
||||
control_chars_to_fragment(&enclosing_node, context, start, restyle_damage));
|
||||
fragments.fragments.push_back(
|
||||
control_chars_to_fragment(&enclosing_node, end, restyle_damage));
|
||||
control_chars_to_fragment(&enclosing_node, context, end, restyle_damage));
|
||||
}
|
||||
}
|
||||
fragments
|
||||
|
@ -340,7 +341,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
}
|
||||
|
||||
/// Builds the fragment for the given block or subclass thereof.
|
||||
fn build_fragment_for_block(&mut self, node: &ConcreteThreadSafeLayoutNode) -> Fragment {
|
||||
fn build_fragment_for_block(&self, node: &ConcreteThreadSafeLayoutNode) -> Fragment {
|
||||
let specific_fragment_info = match node.type_id() {
|
||||
Some(LayoutNodeType::Element(LayoutElementType::HTMLIFrameElement)) => {
|
||||
SpecificFragmentInfo::Iframe(IframeFragmentInfo::new(node))
|
||||
|
@ -399,7 +400,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
absolute_descendants: &mut AbsoluteDescendants,
|
||||
legalizer: &mut Legalizer,
|
||||
node: &ConcreteThreadSafeLayoutNode) {
|
||||
let mut fragments = fragment_accumulator.to_intermediate_inline_fragments();
|
||||
let mut fragments = fragment_accumulator.to_intermediate_inline_fragments(self.style_context());
|
||||
if fragments.is_empty() {
|
||||
return
|
||||
};
|
||||
|
@ -546,14 +547,12 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
ConstructionResult::ConstructionItem(ConstructionItem::Whitespace(
|
||||
whitespace_node,
|
||||
whitespace_pseudo,
|
||||
mut whitespace_style,
|
||||
whitespace_style,
|
||||
whitespace_damage)) => {
|
||||
// Add whitespace results. They will be stripped out later on when
|
||||
// between block elements, and retained when between inline elements.
|
||||
let fragment_info = SpecificFragmentInfo::UnscannedText(
|
||||
box UnscannedTextFragmentInfo::new(" ".to_owned(), None));
|
||||
properties::modify_style_for_replaced_content(&mut whitespace_style);
|
||||
properties::modify_style_for_text(&mut whitespace_style);
|
||||
let fragment = Fragment::from_opaque_node_and_style(whitespace_node,
|
||||
whitespace_pseudo,
|
||||
whitespace_style,
|
||||
|
@ -644,7 +643,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
/// `<textarea>`.
|
||||
fn build_flow_for_block_like(&mut self, flow: FlowRef, node: &ConcreteThreadSafeLayoutNode)
|
||||
-> ConstructionResult {
|
||||
let mut initial_fragments = IntermediateInlineFragments::new();
|
||||
let mut fragments = IntermediateInlineFragments::new();
|
||||
let node_is_input_or_text_area =
|
||||
node.type_id() == Some(LayoutNodeType::Element(LayoutElementType::HTMLInputElement)) ||
|
||||
node.type_id() == Some(LayoutNodeType::Element(LayoutElementType::HTMLTextAreaElement));
|
||||
|
@ -658,17 +657,18 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
}
|
||||
}
|
||||
|
||||
let mut style = node.style(self.style_context());
|
||||
let context = self.style_context();
|
||||
let mut style = node.style(context);
|
||||
style = context.stylist.style_for_anonymous(
|
||||
&context.guards, &PseudoElement::ServoText, &style);
|
||||
if node_is_input_or_text_area {
|
||||
let context = self.style_context();
|
||||
style = context.stylist.style_for_anonymous_box(
|
||||
style = context.stylist.style_for_anonymous(
|
||||
&context.guards, &PseudoElement::ServoInputText, &style)
|
||||
}
|
||||
|
||||
self.create_fragments_for_node_text_content(&mut initial_fragments, node, &style)
|
||||
self.create_fragments_for_node_text_content(&mut fragments, node, &style)
|
||||
}
|
||||
|
||||
self.build_flow_for_block_starting_with_fragments(flow, node, initial_fragments)
|
||||
self.build_flow_for_block_starting_with_fragments(flow, node, fragments)
|
||||
}
|
||||
|
||||
/// Pushes fragments appropriate for the content of the given node onto the given list.
|
||||
|
@ -682,13 +682,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
return
|
||||
}
|
||||
|
||||
let mut style = (*style).clone();
|
||||
match node.get_pseudo_element_type() {
|
||||
PseudoElementType::Before(_) |
|
||||
PseudoElementType::After(_) => {}
|
||||
_ => properties::modify_style_for_text(&mut style)
|
||||
}
|
||||
|
||||
let style = (*style).clone();
|
||||
let selected_style = node.selected_style();
|
||||
|
||||
match text_content {
|
||||
|
@ -824,13 +818,11 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
ConstructionResult::ConstructionItem(ConstructionItem::Whitespace(
|
||||
whitespace_node,
|
||||
whitespace_pseudo,
|
||||
mut whitespace_style,
|
||||
whitespace_style,
|
||||
whitespace_damage)) => {
|
||||
// Instantiate the whitespace fragment.
|
||||
let fragment_info = SpecificFragmentInfo::UnscannedText(
|
||||
box UnscannedTextFragmentInfo::new(" ".to_owned(), None));
|
||||
properties::modify_style_for_replaced_content(&mut whitespace_style);
|
||||
properties::modify_style_for_text(&mut whitespace_style);
|
||||
let fragment =
|
||||
Fragment::from_opaque_node_and_style(whitespace_node,
|
||||
whitespace_pseudo,
|
||||
|
@ -852,12 +844,9 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
// An empty inline box needs at least one fragment to draw its background and borders.
|
||||
let info = SpecificFragmentInfo::UnscannedText(
|
||||
box UnscannedTextFragmentInfo::new(String::new(), None));
|
||||
let mut modified_style = node_style.clone();
|
||||
properties::modify_style_for_replaced_content(&mut modified_style);
|
||||
properties::modify_style_for_text(&mut modified_style);
|
||||
let fragment = Fragment::from_opaque_node_and_style(node.opaque(),
|
||||
node.get_pseudo_element_type().strip(),
|
||||
modified_style,
|
||||
node_style.clone(),
|
||||
node.selected_style(),
|
||||
node.restyle_damage(),
|
||||
info);
|
||||
|
@ -880,7 +869,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
let construction_item = ConstructionItem::InlineFragments(
|
||||
InlineFragmentsConstructionResult {
|
||||
splits: opt_inline_block_splits,
|
||||
fragments: fragment_accumulator.to_intermediate_inline_fragments(),
|
||||
fragments: fragment_accumulator.to_intermediate_inline_fragments(self.style_context()),
|
||||
});
|
||||
ConstructionResult::ConstructionItem(construction_item)
|
||||
} else {
|
||||
|
@ -897,31 +886,27 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
self.set_flow_construction_result(&kid, ConstructionResult::None)
|
||||
}
|
||||
|
||||
let context = self.style_context();
|
||||
let style = node.style(context);
|
||||
// If this node is ignorable whitespace, bail out now.
|
||||
if node.is_ignorable_whitespace(self.style_context()) {
|
||||
if node.is_ignorable_whitespace(context) {
|
||||
return ConstructionResult::ConstructionItem(ConstructionItem::Whitespace(
|
||||
node.opaque(),
|
||||
node.get_pseudo_element_type().strip(),
|
||||
node.style(self.style_context()),
|
||||
context.stylist.style_for_anonymous(
|
||||
&context.guards, &PseudoElement::ServoText, &style),
|
||||
node.restyle_damage()))
|
||||
}
|
||||
|
||||
// Modify the style as necessary. (See the comment in
|
||||
// `properties::modify_style_for_replaced_content()`.)
|
||||
let mut style = node.style(self.style_context());
|
||||
match node.get_pseudo_element_type() {
|
||||
PseudoElementType::Before(_) |
|
||||
PseudoElementType::After(_) => {}
|
||||
_ => properties::modify_style_for_replaced_content(&mut style)
|
||||
}
|
||||
|
||||
// If this is generated content, then we need to initialize the accumulator with the
|
||||
// fragment corresponding to that content. Otherwise, just initialize with the ordinary
|
||||
// fragment that needs to be generated for this inline node.
|
||||
let mut fragments = IntermediateInlineFragments::new();
|
||||
match (node.get_pseudo_element_type(), node.type_id()) {
|
||||
(_, Some(LayoutNodeType::Text)) => {
|
||||
self.create_fragments_for_node_text_content(&mut fragments, node, &style)
|
||||
let text_style = context.stylist.style_for_anonymous(
|
||||
&context.guards, &PseudoElement::ServoText, &style);
|
||||
self.create_fragments_for_node_text_content(&mut fragments, node, &text_style)
|
||||
}
|
||||
(PseudoElementType::Normal, _) => {
|
||||
fragments.fragments.push_back(self.build_fragment_for_block(node));
|
||||
|
@ -950,13 +935,15 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
_ => unreachable!()
|
||||
};
|
||||
|
||||
let mut modified_style = node.style(self.style_context());
|
||||
properties::modify_style_for_outer_inline_block_fragment(&mut modified_style);
|
||||
let context = self.style_context();
|
||||
let style = node.style(context);
|
||||
let style = context.stylist.style_for_anonymous(
|
||||
&context.guards, &PseudoElement::ServoInlineBlockWrapper, &style);
|
||||
let fragment_info = SpecificFragmentInfo::InlineBlock(InlineBlockFragmentInfo::new(
|
||||
block_flow));
|
||||
let fragment = Fragment::from_opaque_node_and_style(node.opaque(),
|
||||
node.get_pseudo_element_type().strip(),
|
||||
modified_style,
|
||||
style,
|
||||
node.selected_style(),
|
||||
node.restyle_damage(),
|
||||
fragment_info);
|
||||
|
@ -968,7 +955,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
let construction_item =
|
||||
ConstructionItem::InlineFragments(InlineFragmentsConstructionResult {
|
||||
splits: LinkedList::new(),
|
||||
fragments: fragment_accumulator.to_intermediate_inline_fragments(),
|
||||
fragments: fragment_accumulator.to_intermediate_inline_fragments(context),
|
||||
});
|
||||
ConstructionResult::ConstructionItem(construction_item)
|
||||
}
|
||||
|
@ -987,8 +974,9 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
let fragment_info = SpecificFragmentInfo::InlineAbsoluteHypothetical(
|
||||
InlineAbsoluteHypotheticalFragmentInfo::new(block_flow));
|
||||
let style_context = self.style_context();
|
||||
let mut style = node.style(style_context);
|
||||
properties::modify_style_for_inline_absolute_hypothetical_fragment(&mut style);
|
||||
let style = node.style(style_context);
|
||||
let style = style_context.stylist.style_for_anonymous(
|
||||
&style_context.guards, &PseudoElement::ServoInlineAbsolute, &style);
|
||||
let fragment = Fragment::from_opaque_node_and_style(node.opaque(),
|
||||
PseudoElementType::Normal,
|
||||
style,
|
||||
|
@ -1003,7 +991,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
let construction_item =
|
||||
ConstructionItem::InlineFragments(InlineFragmentsConstructionResult {
|
||||
splits: LinkedList::new(),
|
||||
fragments: fragment_accumulator.to_intermediate_inline_fragments(),
|
||||
fragments: fragment_accumulator.to_intermediate_inline_fragments(style_context),
|
||||
});
|
||||
ConstructionResult::ConstructionItem(construction_item)
|
||||
}
|
||||
|
@ -1100,7 +1088,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
{
|
||||
let context = self.style_context();
|
||||
table_style = node.style(context);
|
||||
wrapper_style = context.stylist.style_for_anonymous_box(
|
||||
wrapper_style = context.stylist.style_for_anonymous(
|
||||
&context.guards, &PseudoElement::ServoTableWrapper, &table_style);
|
||||
}
|
||||
let wrapper_fragment =
|
||||
|
@ -1367,7 +1355,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
|
||||
let mut set_has_newly_constructed_flow_flag = false;
|
||||
let result = {
|
||||
let mut style = node.style(self.style_context());
|
||||
let style = node.style(self.style_context());
|
||||
let damage = node.restyle_damage();
|
||||
let mut data = node.mutate_layout_data().unwrap();
|
||||
|
||||
|
@ -1438,9 +1426,6 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
|||
return false
|
||||
}
|
||||
_ => {
|
||||
if node.is_replaced_content() {
|
||||
properties::modify_style_for_replaced_content(&mut style);
|
||||
}
|
||||
fragment.repair_style(&style);
|
||||
set_has_newly_constructed_flow_flag = true;
|
||||
}
|
||||
|
@ -1842,17 +1827,17 @@ fn bidi_control_chars(style: &Arc<ServoComputedValues>) -> Option<(&'static str,
|
|||
}
|
||||
|
||||
fn control_chars_to_fragment(node: &InlineFragmentNodeInfo,
|
||||
context: &SharedStyleContext,
|
||||
text: &str,
|
||||
restyle_damage: RestyleDamage)
|
||||
-> Fragment {
|
||||
let info = SpecificFragmentInfo::UnscannedText(
|
||||
box UnscannedTextFragmentInfo::new(String::from(text), None));
|
||||
let mut style = node.style.clone();
|
||||
properties::modify_style_for_replaced_content(&mut style);
|
||||
properties::modify_style_for_text(&mut style);
|
||||
let text_style = context.stylist.style_for_anonymous(
|
||||
&context.guards, &PseudoElement::ServoText, &node.style);
|
||||
Fragment::from_opaque_node_and_style(node.address,
|
||||
node.pseudo,
|
||||
style.clone(),
|
||||
text_style,
|
||||
node.selected_style.clone(),
|
||||
restyle_damage,
|
||||
info)
|
||||
|
@ -2082,7 +2067,7 @@ impl Legalizer {
|
|||
let reference_block = reference.as_block();
|
||||
let mut new_style = reference_block.fragment.style.clone();
|
||||
for pseudo in pseudos {
|
||||
new_style = context.stylist.style_for_anonymous_box(&context.guards, pseudo, &new_style)
|
||||
new_style = context.stylist.style_for_anonymous(&context.guards, pseudo, &new_style)
|
||||
}
|
||||
let fragment = reference_block.fragment
|
||||
.create_similar_anonymous_fragment(new_style,
|
||||
|
|
|
@ -1167,20 +1167,15 @@ impl Fragment {
|
|||
/// can be expensive to compute, so if possible use the `border_padding` field instead.
|
||||
#[inline]
|
||||
pub fn border_width(&self) -> LogicalMargin<Au> {
|
||||
let style_border_width = match self.specific {
|
||||
SpecificFragmentInfo::ScannedText(_) |
|
||||
SpecificFragmentInfo::InlineBlock(_) => LogicalMargin::zero(self.style.writing_mode),
|
||||
_ => self.style().logical_border_width(),
|
||||
};
|
||||
let style_border_width = self.style().logical_border_width();
|
||||
|
||||
match self.inline_context {
|
||||
None => style_border_width,
|
||||
// NOTE: We can have nodes with different writing mode inside
|
||||
// the inline fragment context, so we need to overwrite the
|
||||
// writing mode to compute the child logical sizes.
|
||||
let writing_mode = self.style.writing_mode;
|
||||
let context_border = match self.inline_context {
|
||||
None => LogicalMargin::zero(writing_mode),
|
||||
Some(ref inline_fragment_context) => {
|
||||
// NOTE: We can have nodes with different writing mode inside
|
||||
// the inline fragment context, so we need to overwrite the
|
||||
// writing mode to compute the child logical sizes.
|
||||
let writing_mode = self.style.writing_mode;
|
||||
|
||||
inline_fragment_context.nodes.iter().fold(style_border_width, |accumulator, node| {
|
||||
let mut this_border_width =
|
||||
node.style.border_width_for_writing_mode(writing_mode);
|
||||
|
@ -1193,7 +1188,8 @@ impl Fragment {
|
|||
accumulator + this_border_width
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
style_border_width + context_border
|
||||
}
|
||||
|
||||
/// Returns the border width in given direction if this fragment has property
|
||||
|
@ -1226,12 +1222,6 @@ impl Fragment {
|
|||
self.margin.inline_end = Au(0);
|
||||
return
|
||||
}
|
||||
SpecificFragmentInfo::InlineBlock(_) => {
|
||||
// Inline-blocks do not take self margins into account but do account for margins
|
||||
// from outer inline contexts.
|
||||
self.margin.inline_start = Au(0);
|
||||
self.margin.inline_end = Au(0);
|
||||
}
|
||||
_ => {
|
||||
let margin = self.style().logical_margin();
|
||||
self.margin.inline_start =
|
||||
|
@ -1259,8 +1249,8 @@ impl Fragment {
|
|||
containing_block_inline_size).specified_or_zero()
|
||||
};
|
||||
|
||||
self.margin.inline_start = self.margin.inline_start + this_inline_start_margin;
|
||||
self.margin.inline_end = self.margin.inline_end + this_inline_end_margin;
|
||||
self.margin.inline_start += this_inline_start_margin;
|
||||
self.margin.inline_end += this_inline_end_margin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1309,14 +1299,10 @@ impl Fragment {
|
|||
};
|
||||
|
||||
// Compute padding from the fragment's style.
|
||||
//
|
||||
// This is zero in the case of `inline-block` because that padding is applied to the
|
||||
// wrapped block, not the fragment.
|
||||
let padding_from_style = match self.specific {
|
||||
SpecificFragmentInfo::TableColumn(_) |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TableWrapper |
|
||||
SpecificFragmentInfo::InlineBlock(_) => LogicalMargin::zero(self.style.writing_mode),
|
||||
SpecificFragmentInfo::TableWrapper => LogicalMargin::zero(self.style.writing_mode),
|
||||
_ => model::padding_from_style(self.style(), containing_block_inline_size, self.style().writing_mode),
|
||||
};
|
||||
|
||||
|
|
|
@ -326,7 +326,8 @@ impl CoreResourceManager {
|
|||
hsts_list: group.hsts_list.clone(),
|
||||
cookie_jar: group.cookie_jar.clone(),
|
||||
auth_cache: group.auth_cache.clone(),
|
||||
connector_pool: group.connector.clone(),
|
||||
// FIXME(#15694): use group.connector.clone() instead.
|
||||
connector_pool: create_http_connector("certs"),
|
||||
};
|
||||
let ua = self.user_agent.clone();
|
||||
let dc = self.devtools_chan.clone();
|
||||
|
|
|
@ -788,16 +788,7 @@ impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
|
|||
self.node.type_id()
|
||||
}
|
||||
|
||||
fn style_for_text_node(&self) -> Arc<ComputedValues> {
|
||||
// Text nodes get a copy of the parent style. Inheriting all non-
|
||||
// inherited properties into the text node is odd from a CSS
|
||||
// perspective, but makes fragment construction easier (by making
|
||||
// properties like vertical-align on fragments have values that
|
||||
// match the parent element). This is an implementation detail of
|
||||
// Servo layout that is not central to how fragment construction
|
||||
// works, but would be difficult to change. (Text node style is
|
||||
// also not visible to script.)
|
||||
debug_assert!(self.is_text_node());
|
||||
fn parent_style(&self) -> Arc<ComputedValues> {
|
||||
let parent = self.node.parent_node().unwrap().as_element().unwrap();
|
||||
let parent_data = parent.get_data().unwrap().borrow();
|
||||
parent_data.styles().primary.values().clone()
|
||||
|
|
|
@ -176,7 +176,7 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + Debug + GetLayoutData + NodeInfo
|
|||
/// it can be used to reach siblings and cousins. A simple immutable borrow
|
||||
/// of the parent data is fine, since the bottom-up traversal will not process
|
||||
/// the parent until all the children have been processed.
|
||||
fn style_for_text_node(&self) -> Arc<ServoComputedValues>;
|
||||
fn parent_style(&self) -> Arc<ServoComputedValues>;
|
||||
|
||||
#[inline]
|
||||
fn is_element_or_elements_pseudo(&self) -> bool {
|
||||
|
@ -222,8 +222,10 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + Debug + GetLayoutData + NodeInfo
|
|||
if let Some(el) = self.as_element() {
|
||||
el.style(context)
|
||||
} else {
|
||||
// Text nodes are not styled during traversal,instead we simply
|
||||
// return parent style here and do cascading during layout.
|
||||
debug_assert!(self.is_text_node());
|
||||
self.style_for_text_node()
|
||||
self.parent_style()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -232,7 +234,8 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + Debug + GetLayoutData + NodeInfo
|
|||
el.selected_style()
|
||||
} else {
|
||||
debug_assert!(self.is_text_node());
|
||||
self.style_for_text_node()
|
||||
// TODO(stshine): What should the selected style be for text?
|
||||
self.parent_style()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -386,6 +386,10 @@ pub trait TElement : PartialEq + Debug + Sized + Copy + Clone + ElementExt + Pre
|
|||
unsafe fn unset_animation_only_dirty_descendants(&self) {
|
||||
}
|
||||
|
||||
/// Returns true if this element is native anonymous (only Gecko has native
|
||||
/// anonymous content).
|
||||
fn is_native_anonymous(&self) -> bool { false }
|
||||
|
||||
/// Atomically stores the number of children of this node that we will
|
||||
/// need to process during bottom-up traversal.
|
||||
fn store_children_to_process(&self, n: isize);
|
||||
|
|
|
@ -47,6 +47,7 @@ use gecko_bindings::structs::EffectCompositor_CascadeLevel as CascadeLevel;
|
|||
use gecko_bindings::structs::NODE_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO;
|
||||
use gecko_bindings::structs::NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO;
|
||||
use gecko_bindings::structs::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE;
|
||||
use gecko_bindings::structs::NODE_IS_NATIVE_ANONYMOUS;
|
||||
use gecko_bindings::sugar::ownership::HasArcFFI;
|
||||
use parking_lot::RwLock;
|
||||
use parser::ParserContextExtraData;
|
||||
|
@ -543,6 +544,10 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
self.unset_flags(NODE_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO as u32)
|
||||
}
|
||||
|
||||
fn is_native_anonymous(&self) -> bool {
|
||||
self.flags() & (NODE_IS_NATIVE_ANONYMOUS as u32) != 0
|
||||
}
|
||||
|
||||
fn store_children_to_process(&self, _: isize) {
|
||||
// This is only used for bottom-up traversal, and is thus a no-op for Gecko.
|
||||
}
|
||||
|
|
|
@ -2398,96 +2398,6 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
|
|||
style
|
||||
}
|
||||
|
||||
/// Modifies the style for an anonymous flow so it resets all its non-inherited
|
||||
/// style structs, and set their borders and outlines to zero.
|
||||
///
|
||||
/// Also, it gets a new display value, which is honored except when it's
|
||||
/// `inline`.
|
||||
#[cfg(feature = "servo")]
|
||||
pub fn modify_style_for_anonymous_flow(style: &mut Arc<ComputedValues>,
|
||||
new_display_value: longhands::display::computed_value::T) {
|
||||
// The 'align-self' property needs some special treatment since
|
||||
// its value depends on the 'align-items' value of its parent.
|
||||
% if "align-items" in data.longhands_by_name:
|
||||
use computed_values::align_self::T as align_self;
|
||||
use computed_values::align_items::T as align_items;
|
||||
let self_align =
|
||||
match style.position.align_items {
|
||||
align_items::stretch => align_self::stretch,
|
||||
align_items::baseline => align_self::baseline,
|
||||
align_items::flex_start => align_self::flex_start,
|
||||
align_items::flex_end => align_self::flex_end,
|
||||
align_items::center => align_self::center,
|
||||
};
|
||||
% endif
|
||||
let inital_values = &*INITIAL_SERVO_VALUES;
|
||||
let mut style = Arc::make_mut(style);
|
||||
% for style_struct in data.active_style_structs():
|
||||
% if not style_struct.inherited:
|
||||
style.${style_struct.ident} = inital_values.clone_${style_struct.name_lower}();
|
||||
% endif
|
||||
% endfor
|
||||
% if "align-items" in data.longhands_by_name:
|
||||
let position = Arc::make_mut(&mut style.position);
|
||||
position.align_self = self_align;
|
||||
% endif
|
||||
if new_display_value != longhands::display::computed_value::T::inline {
|
||||
let new_box = Arc::make_mut(&mut style.box_);
|
||||
new_box.display = new_display_value;
|
||||
}
|
||||
let border = Arc::make_mut(&mut style.border);
|
||||
% for side in ["top", "right", "bottom", "left"]:
|
||||
// Like calling to_computed_value, which wouldn't type check.
|
||||
border.border_${side}_width = Au(0);
|
||||
% endfor
|
||||
// Initial value of outline-style is always none for anonymous box.
|
||||
let outline = Arc::make_mut(&mut style.outline);
|
||||
outline.outline_width = Au(0);
|
||||
}
|
||||
|
||||
/// Alters the given style to accommodate replaced content. This is called in
|
||||
/// flow construction. It handles cases like:
|
||||
///
|
||||
/// <div style="position: absolute">foo bar baz</div>
|
||||
///
|
||||
/// (in which `foo`, `bar`, and `baz` must not be absolutely-positioned) and
|
||||
/// cases like `<sup>Foo</sup>` (in which the `vertical-align: top` style of
|
||||
/// `sup` must not propagate down into `Foo`).
|
||||
///
|
||||
/// FIXME(#5625, pcwalton): It would probably be cleaner and faster to do this
|
||||
/// in the cascade.
|
||||
#[cfg(feature = "servo")]
|
||||
#[inline]
|
||||
pub fn modify_style_for_replaced_content(style: &mut Arc<ComputedValues>) {
|
||||
// Reset `position` to handle cases like `<div style="position: absolute">foo bar baz</div>`.
|
||||
if style.box_.display != longhands::display::computed_value::T::inline {
|
||||
let mut style = Arc::make_mut(style);
|
||||
Arc::make_mut(&mut style.box_).display = longhands::display::computed_value::T::inline;
|
||||
Arc::make_mut(&mut style.box_).position =
|
||||
longhands::position::computed_value::T::static_;
|
||||
}
|
||||
|
||||
// Reset `vertical-align` to handle cases like `<sup>foo</sup>`.
|
||||
if style.box_.vertical_align != longhands::vertical_align::computed_value::T::baseline {
|
||||
let mut style = Arc::make_mut(style);
|
||||
Arc::make_mut(&mut style.box_).vertical_align =
|
||||
longhands::vertical_align::computed_value::T::baseline
|
||||
}
|
||||
|
||||
// Reset margins.
|
||||
if style.margin.margin_top != computed::LengthOrPercentageOrAuto::Length(Au(0)) ||
|
||||
style.margin.margin_left != computed::LengthOrPercentageOrAuto::Length(Au(0)) ||
|
||||
style.margin.margin_bottom != computed::LengthOrPercentageOrAuto::Length(Au(0)) ||
|
||||
style.margin.margin_right != computed::LengthOrPercentageOrAuto::Length(Au(0)) {
|
||||
let mut style = Arc::make_mut(style);
|
||||
let margin = Arc::make_mut(&mut style.margin);
|
||||
margin.margin_top = computed::LengthOrPercentageOrAuto::Length(Au(0));
|
||||
margin.margin_left = computed::LengthOrPercentageOrAuto::Length(Au(0));
|
||||
margin.margin_bottom = computed::LengthOrPercentageOrAuto::Length(Au(0));
|
||||
margin.margin_right = computed::LengthOrPercentageOrAuto::Length(Au(0));
|
||||
}
|
||||
}
|
||||
|
||||
/// Adjusts borders as appropriate to account for a fragment's status as the
|
||||
/// first or last fragment within the range of an element.
|
||||
///
|
||||
|
@ -2544,65 +2454,6 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc<ComputedValues>,
|
|||
}
|
||||
}
|
||||
|
||||
/// Adjusts the `position` property as necessary for the outer fragment wrapper
|
||||
/// of an inline-block.
|
||||
#[cfg(feature = "servo")]
|
||||
#[inline]
|
||||
pub fn modify_style_for_outer_inline_block_fragment(style: &mut Arc<ComputedValues>) {
|
||||
let mut style = Arc::make_mut(style);
|
||||
let box_style = Arc::make_mut(&mut style.box_);
|
||||
box_style.position = longhands::position::computed_value::T::static_
|
||||
}
|
||||
|
||||
/// Adjusts the `position` and `padding` properties as necessary to account for
|
||||
/// text.
|
||||
///
|
||||
/// Text is never directly relatively positioned; it's always contained within
|
||||
/// an element that is itself relatively positioned.
|
||||
#[cfg(feature = "servo")]
|
||||
#[inline]
|
||||
pub fn modify_style_for_text(style: &mut Arc<ComputedValues>) {
|
||||
if style.box_.position == longhands::position::computed_value::T::relative {
|
||||
// We leave the `position` property set to `relative` so that we'll still establish a
|
||||
// containing block if needed. But we reset all position offsets to `auto`.
|
||||
let mut style = Arc::make_mut(style);
|
||||
let mut position = Arc::make_mut(&mut style.position);
|
||||
position.top = computed::LengthOrPercentageOrAuto::Auto;
|
||||
position.right = computed::LengthOrPercentageOrAuto::Auto;
|
||||
position.bottom = computed::LengthOrPercentageOrAuto::Auto;
|
||||
position.left = computed::LengthOrPercentageOrAuto::Auto;
|
||||
}
|
||||
|
||||
if style.padding.padding_top != computed::LengthOrPercentage::Length(Au(0)) ||
|
||||
style.padding.padding_right != computed::LengthOrPercentage::Length(Au(0)) ||
|
||||
style.padding.padding_bottom != computed::LengthOrPercentage::Length(Au(0)) ||
|
||||
style.padding.padding_left != computed::LengthOrPercentage::Length(Au(0)) {
|
||||
let mut style = Arc::make_mut(style);
|
||||
let mut padding = Arc::make_mut(&mut style.padding);
|
||||
padding.padding_top = computed::LengthOrPercentage::Length(Au(0));
|
||||
padding.padding_right = computed::LengthOrPercentage::Length(Au(0));
|
||||
padding.padding_bottom = computed::LengthOrPercentage::Length(Au(0));
|
||||
padding.padding_left = computed::LengthOrPercentage::Length(Au(0));
|
||||
}
|
||||
|
||||
if style.effects.opacity != 1.0 {
|
||||
let mut style = Arc::make_mut(style);
|
||||
let mut effects = Arc::make_mut(&mut style.effects);
|
||||
effects.opacity = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
/// Adjusts the `clip` property so that an inline absolute hypothetical fragment
|
||||
/// doesn't clip its children.
|
||||
#[cfg(feature = "servo")]
|
||||
pub fn modify_style_for_inline_absolute_hypothetical_fragment(style: &mut Arc<ComputedValues>) {
|
||||
if !style.get_effects().clip.is_auto() {
|
||||
let mut style = Arc::make_mut(style);
|
||||
let effects_style = Arc::make_mut(&mut style.effects);
|
||||
effects_style.clip = Either::auto()
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! css_properties_accessors {
|
||||
($macro_name: ident) => {
|
||||
|
|
|
@ -32,6 +32,7 @@ pub enum PseudoElement {
|
|||
Selection,
|
||||
DetailsSummary,
|
||||
DetailsContent,
|
||||
ServoText,
|
||||
ServoInputText,
|
||||
ServoTableWrapper,
|
||||
ServoAnonymousTableWrapper,
|
||||
|
@ -39,6 +40,8 @@ pub enum PseudoElement {
|
|||
ServoAnonymousTableRow,
|
||||
ServoAnonymousTableCell,
|
||||
ServoAnonymousBlock,
|
||||
ServoInlineBlockWrapper,
|
||||
ServoInlineAbsolute,
|
||||
}
|
||||
|
||||
impl ToCss for PseudoElement {
|
||||
|
@ -50,6 +53,7 @@ impl ToCss for PseudoElement {
|
|||
Selection => "::selection",
|
||||
DetailsSummary => "::-servo-details-summary",
|
||||
DetailsContent => "::-servo-details-content",
|
||||
ServoText => "::-servo-text",
|
||||
ServoInputText => "::-servo-input-text",
|
||||
ServoTableWrapper => "::-servo-table-wrapper",
|
||||
ServoAnonymousTableWrapper => "::-servo-anonymous-table-wrapper",
|
||||
|
@ -57,6 +61,8 @@ impl ToCss for PseudoElement {
|
|||
ServoAnonymousTableRow => "::-servo-anonymous-table-row",
|
||||
ServoAnonymousTableCell => "::-servo-anonymous-table-cell",
|
||||
ServoAnonymousBlock => "::-servo-anonymous-block",
|
||||
ServoInlineBlockWrapper => "::-servo-inline-block-wrapper",
|
||||
ServoInlineAbsolute => "::-servo-inline-absolute",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -83,13 +89,16 @@ impl PseudoElement {
|
|||
PseudoElement::Selection => PseudoElementCascadeType::Eager,
|
||||
PseudoElement::DetailsSummary => PseudoElementCascadeType::Lazy,
|
||||
PseudoElement::DetailsContent |
|
||||
PseudoElement::ServoText |
|
||||
PseudoElement::ServoInputText |
|
||||
PseudoElement::ServoTableWrapper |
|
||||
PseudoElement::ServoAnonymousTableWrapper |
|
||||
PseudoElement::ServoAnonymousTable |
|
||||
PseudoElement::ServoAnonymousTableRow |
|
||||
PseudoElement::ServoAnonymousTableCell |
|
||||
PseudoElement::ServoAnonymousBlock => PseudoElementCascadeType::Precomputed,
|
||||
PseudoElement::ServoAnonymousBlock |
|
||||
PseudoElement::ServoInlineBlockWrapper |
|
||||
PseudoElement::ServoInlineAbsolute => PseudoElementCascadeType::Precomputed,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -278,6 +287,12 @@ impl<'a> ::selectors::Parser for SelectorParser<'a> {
|
|||
}
|
||||
DetailsContent
|
||||
},
|
||||
"-servo-text" => {
|
||||
if !self.in_user_agent_stylesheet() {
|
||||
return Err(())
|
||||
}
|
||||
ServoText
|
||||
},
|
||||
"-servo-input-text" => {
|
||||
if !self.in_user_agent_stylesheet() {
|
||||
return Err(())
|
||||
|
@ -320,6 +335,18 @@ impl<'a> ::selectors::Parser for SelectorParser<'a> {
|
|||
}
|
||||
ServoAnonymousBlock
|
||||
},
|
||||
"-servo-inline-block-wrapper" => {
|
||||
if !self.in_user_agent_stylesheet() {
|
||||
return Err(())
|
||||
}
|
||||
ServoInlineBlockWrapper
|
||||
},
|
||||
"-servo-input-absolute" => {
|
||||
if !self.in_user_agent_stylesheet() {
|
||||
return Err(())
|
||||
}
|
||||
ServoInlineAbsolute
|
||||
},
|
||||
_ => return Err(())
|
||||
};
|
||||
|
||||
|
@ -352,6 +379,7 @@ impl SelectorImpl {
|
|||
fun(PseudoElement::DetailsContent);
|
||||
fun(PseudoElement::DetailsSummary);
|
||||
fun(PseudoElement::Selection);
|
||||
fun(PseudoElement::ServoText);
|
||||
fun(PseudoElement::ServoInputText);
|
||||
fun(PseudoElement::ServoTableWrapper);
|
||||
fun(PseudoElement::ServoAnonymousTableWrapper);
|
||||
|
@ -359,6 +387,8 @@ impl SelectorImpl {
|
|||
fun(PseudoElement::ServoAnonymousTableRow);
|
||||
fun(PseudoElement::ServoAnonymousTableCell);
|
||||
fun(PseudoElement::ServoAnonymousBlock);
|
||||
fun(PseudoElement::ServoInlineBlockWrapper);
|
||||
fun(PseudoElement::ServoInlineAbsolute);
|
||||
}
|
||||
|
||||
/// Returns the pseudo-class state flag for selector matching.
|
||||
|
|
|
@ -385,20 +385,23 @@ impl Stylist {
|
|||
|
||||
/// Returns the style for an anonymous box of the given type.
|
||||
#[cfg(feature = "servo")]
|
||||
pub fn style_for_anonymous_box(&self,
|
||||
guards: &StylesheetGuards,
|
||||
pseudo: &PseudoElement,
|
||||
parent_style: &Arc<ComputedValues>)
|
||||
-> Arc<ComputedValues> {
|
||||
pub fn style_for_anonymous(&self,
|
||||
guards: &StylesheetGuards,
|
||||
pseudo: &PseudoElement,
|
||||
parent_style: &Arc<ComputedValues>)
|
||||
-> Arc<ComputedValues> {
|
||||
// For most (but not all) pseudo-elements, we inherit all values from the parent.
|
||||
let inherit_all = match *pseudo {
|
||||
PseudoElement::ServoText |
|
||||
PseudoElement::ServoInputText => false,
|
||||
PseudoElement::ServoAnonymousBlock |
|
||||
PseudoElement::ServoAnonymousTable |
|
||||
PseudoElement::ServoAnonymousTableCell |
|
||||
PseudoElement::ServoAnonymousTableRow |
|
||||
PseudoElement::ServoAnonymousTableWrapper |
|
||||
PseudoElement::ServoTableWrapper => true,
|
||||
PseudoElement::ServoTableWrapper |
|
||||
PseudoElement::ServoInlineBlockWrapper |
|
||||
PseudoElement::ServoInlineAbsolute => true,
|
||||
PseudoElement::Before |
|
||||
PseudoElement::After |
|
||||
PseudoElement::Selection |
|
||||
|
|
|
@ -182,6 +182,21 @@ pub trait DomTraversal<E: TElement> : Sync {
|
|||
match node.as_element() {
|
||||
None => Self::text_node_needs_traversal(node),
|
||||
Some(el) => {
|
||||
// If the element is native-anonymous and an ancestor frame will
|
||||
// be reconstructed, the child and all its descendants will be
|
||||
// destroyed. In that case, we don't need to traverse the subtree.
|
||||
if el.is_native_anonymous() {
|
||||
if let Some(parent) = el.parent_element() {
|
||||
let parent_data = parent.borrow_data().unwrap();
|
||||
if let Some(r) = parent_data.get_restyle() {
|
||||
if (r.damage | r.damage_handled()).contains(RestyleDamage::reconstruct()) {
|
||||
debug!("Element {:?} is in doomed NAC subtree - culling traversal", el);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// In case of animation-only traversal we need to traverse
|
||||
// the element if the element has animation only dirty
|
||||
// descendants bit, animation-only restyle hint or recascade.
|
||||
|
|
|
@ -168,6 +168,12 @@ svg > * {
|
|||
display: none;
|
||||
}
|
||||
|
||||
/* style for text node. */
|
||||
*|*::-servo-text {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* style for text in input elements. */
|
||||
*|*::-servo-input-text {
|
||||
margin: 0;
|
||||
}
|
||||
|
@ -215,3 +221,18 @@ svg > * {
|
|||
height: auto;
|
||||
}
|
||||
|
||||
/* The outer fragment wrapper of an inline-block. */
|
||||
*|*::-servo-inline-block-wrapper {
|
||||
position: static;
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* The outer fragment wrapper of an inline absolute hypothetical fragment. */
|
||||
*|*::-servo-inline-absolute {
|
||||
clip: auto;
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче