mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #8257 - eefriedman:reorder-webfont-check, r=mbrubeck
Attempt to fix webfont-related intermittent test failures. I'm not completely sure the race condition outlined in this patch is actually the race condition causing failures... but it's a possibility. (I plan to run this through try a couple of times to see if it actually helps.) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8257) <!-- Reviewable:end -->
This commit is contained in:
commit
cff9a54569
1 changed files with 15 additions and 7 deletions
|
@ -1203,6 +1203,21 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
for frame in self.current_frame_tree_iter(self.root_frame_id) {
|
for frame in self.current_frame_tree_iter(self.root_frame_id) {
|
||||||
let pipeline = self.pipeline(frame.current);
|
let pipeline = self.pipeline(frame.current);
|
||||||
|
|
||||||
|
// Check to see if there are any webfonts still loading.
|
||||||
|
//
|
||||||
|
// If GetWebFontLoadState returns false, either there are no
|
||||||
|
// webfonts loading, or there's a WebFontLoaded message waiting in
|
||||||
|
// script_chan's message queue. Therefore, we need to check this
|
||||||
|
// before we check whether the document is ready; otherwise,
|
||||||
|
// there's a race condition where a webfont has finished loading,
|
||||||
|
// but hasn't yet notified the document.
|
||||||
|
let (sender, receiver) = ipc::channel().unwrap();
|
||||||
|
let msg = LayoutControlMsg::GetWebFontLoadState(sender);
|
||||||
|
pipeline.layout_chan.0.send(msg).unwrap();
|
||||||
|
if receiver.recv().unwrap() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Synchronously query the script task for this pipeline
|
// Synchronously query the script task for this pipeline
|
||||||
// to see if it is idle.
|
// to see if it is idle.
|
||||||
let (sender, receiver) = channel();
|
let (sender, receiver) = channel();
|
||||||
|
@ -1213,13 +1228,6 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let (sender, receiver) = ipc::channel().unwrap();
|
|
||||||
let msg = LayoutControlMsg::GetWebFontLoadState(sender);
|
|
||||||
pipeline.layout_chan.0.send(msg).unwrap();
|
|
||||||
if receiver.recv().unwrap() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check the visible rectangle for this pipeline. If the constellation has received a
|
// Check the visible rectangle for this pipeline. If the constellation has received a
|
||||||
// size for the pipeline, then its painting should be up to date. If the constellation
|
// size for the pipeline, then its painting should be up to date. If the constellation
|
||||||
// *hasn't* received a size, it could be that the layer was hidden by script before the
|
// *hasn't* received a size, it could be that the layer was hidden by script before the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue