aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread_2020/lib.rs
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-06-12 13:43:51 -0400
committerGitHub <noreply@github.com>2020-06-12 13:43:51 -0400
commit721271dcd3c20db5ca8cf146e2b5907647afb4d6 (patch)
tree75360f129a6172fd64040d46d88bdc2a8b0f66d0 /components/layout_thread_2020/lib.rs
parentcb92a15600771a69a796f88975d8100f4be296ae (diff)
parent502f34a9db36202cd89f7a1b48bd138d2ce6f46e (diff)
downloadservo-721271dcd3c20db5ca8cf146e2b5907647afb4d6.tar.gz
servo-721271dcd3c20db5ca8cf146e2b5907647afb4d6.zip
Auto merge of #26697 - utsavoza:ugo/issue-11681/22-05-2020, r=jdm
Implement CanvasRenderingContext2d.fillText The PR consists of broadly two main changes: - Implementation of Canvas2dRenderingContext.font - Basic implementation of Canvas2dRenderingContext.fillText Although I am not fully sure about the long term goals for the canvas backend in Servo, I assumed limited scope for font and text handling (should support simple text drawing with font selection) in the current implementation as I believe a more complete implementation would eventually be brought in as a part of #22957. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #11681 - [x] There are tests for these changes
Diffstat (limited to 'components/layout_thread_2020/lib.rs')
-rw-r--r--components/layout_thread_2020/lib.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/components/layout_thread_2020/lib.rs b/components/layout_thread_2020/lib.rs
index 3bb0a7a3353..4ae69e6255a 100644
--- a/components/layout_thread_2020/lib.rs
+++ b/components/layout_thread_2020/lib.rs
@@ -37,7 +37,8 @@ use layout::context::LayoutContext;
use layout::display_list::{DisplayListBuilder, WebRenderImageInfo};
use layout::layout_debug;
use layout::query::{
- process_content_box_request, process_content_boxes_request, LayoutRPCImpl, LayoutThreadData,
+ process_content_box_request, process_content_boxes_request, process_resolved_font_style_query,
+ LayoutRPCImpl, LayoutThreadData,
};
use layout::query::{process_element_inner_text_query, process_node_geometry_request};
use layout::query::{process_node_scroll_area_request, process_node_scroll_id_request};
@@ -525,6 +526,7 @@ impl LayoutThread {
scroll_id_response: None,
scroll_area_response: Rect::zero(),
resolved_style_response: String::new(),
+ resolved_font_style_response: None,
offset_parent_response: OffsetParentResponse::empty(),
scroll_offsets: HashMap::new(),
text_index_response: TextIndexResponse(None),
@@ -914,6 +916,9 @@ impl LayoutThread {
&QueryMsg::ResolvedStyleQuery(_, _, _) => {
rw_data.resolved_style_response = String::new();
},
+ &QueryMsg::ResolvedFontStyleQuery(_, _, _) => {
+ rw_data.resolved_font_style_response = None;
+ },
&QueryMsg::OffsetParentQuery(_) => {
rw_data.offset_parent_response = OffsetParentResponse::empty();
},
@@ -1206,6 +1211,11 @@ impl LayoutThread {
fragment_tree,
);
},
+ &QueryMsg::ResolvedFontStyleQuery(node, ref property, ref value) => {
+ let node = unsafe { ServoLayoutNode::new(&node) };
+ rw_data.resolved_font_style_response =
+ process_resolved_font_style_query(node, property, value);
+ },
&QueryMsg::OffsetParentQuery(node) => {
rw_data.offset_parent_response = process_offset_parent_query(node);
},