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 asymmetric border colors #689
Merged
+39
−23
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
| @@ -628,18 +628,17 @@ impl RenderBox { | ||
| // should have a real `SERVO_DEBUG` system. | ||
| debug!("%?", { | ||
| // Compute the text box bounds and draw a border surrounding them. | ||
| let debug_border = SideOffsets2D::new(Au::from_px(1), | ||
| Au::from_px(1), | ||
| Au::from_px(1), | ||
| Au::from_px(1)); | ||
| let debug_border = SideOffsets2D::new_all_same(Au::from_px(1)); | ||
|
|
||
| do list.with_mut_ref |list| { | ||
| let border_display_item = ~BorderDisplayItem { | ||
| base: BaseDisplayItem { | ||
| bounds: absolute_box_bounds, | ||
| extra: ExtraDisplayListData::new(*self), | ||
| }, | ||
| border: debug_border, | ||
| color: rgb(0, 0, 200).to_gfx_color(), | ||
| color: SideOffsets2D::new_all_same(rgb(0, 0, 200).to_gfx_color()) | ||
|
|
||
| }; | ||
sammykim
Author
Contributor
|
||
| list.append_item(BorderDisplayItemClass(border_display_item)) | ||
| } | ||
| @@ -659,7 +658,8 @@ impl RenderBox { | ||
| extra: ExtraDisplayListData::new(*self), | ||
| }, | ||
| border: debug_border, | ||
| color: rgb(0, 200, 0).to_gfx_color(), | ||
| color: SideOffsets2D::new_all_same(rgb(0, 200, 0).to_gfx_color()) | ||
|
|
||
| }; | ||
| list.append_item(BorderDisplayItemClass(border_display_item)) | ||
| } | ||
| @@ -675,10 +675,7 @@ impl RenderBox { | ||
| // FIXME(pcwalton): This is a bit of an abuse of the logging infrastructure. We | ||
| // should have a real `SERVO_DEBUG` system. | ||
| debug!("%?", { | ||
| let debug_border = SideOffsets2D::new(Au::from_px(1), | ||
| Au::from_px(1), | ||
| Au::from_px(1), | ||
| Au::from_px(1)); | ||
| let debug_border = SideOffsets2D::new_all_same(Au::from_px(1)); | ||
|
|
||
| do list.with_mut_ref |list| { | ||
| let border_display_item = ~BorderDisplayItem { | ||
| @@ -687,7 +684,8 @@ impl RenderBox { | ||
| extra: ExtraDisplayListData::new(*self), | ||
| }, | ||
| border: debug_border, | ||
| color: rgb(0, 0, 200).to_gfx_color(), | ||
| color: SideOffsets2D::new_all_same(rgb(0, 0, 200).to_gfx_color()) | ||
|
|
||
| }; | ||
| list.append_item(BorderDisplayItemClass(border_display_item)) | ||
| } | ||
| @@ -914,9 +912,10 @@ impl RenderBox { | ||
| return | ||
| } | ||
|
|
||
| // FIXME: all colors set to top color. this is obviously not right. | ||
| let top_color = self.style().border_top_color(); | ||
| let color = top_color.to_gfx_color(); | ||
| let right_color = self.style().border_right_color(); | ||
| let bottom_color = self.style().border_bottom_color(); | ||
| let left_color = self.style().border_left_color(); | ||
|
|
||
| // Append the border to the display list. | ||
| do list.with_mut_ref |list| { | ||
| @@ -929,7 +928,10 @@ impl RenderBox { | ||
| border.right, | ||
| border.bottom, | ||
| border.left), | ||
| color: color, | ||
| color: SideOffsets2D::new(top_color.to_gfx_color(), | ||
| right_color.to_gfx_color(), | ||
| bottom_color.to_gfx_color(), | ||
| left_color.to_gfx_color()) | ||
| }; | ||
|
|
||
| list.append_item(BorderDisplayItemClass(border_display_item)) | ||
Submodule rust-azure
updated
from a54b84 to cb2c8b
Submodule rust-geom
updated
from fb352c to 43a9db
| @@ -0,0 +1,15 @@ | ||
| <HTML> | ||
| <HEAD> | ||
| <TITLE>Examples of margins, padding, and borders</TITLE> | ||
| <STYLE type="text/css"> | ||
| LI.withborder { | ||
| border-style: dashed; | ||
| border-width: 10px; | ||
| border-color: yellow black red green; | ||
| } | ||
| </STYLE> | ||
| </HEAD> | ||
| <BODY> | ||
| <LI class="withborder">Second element of list is a bit longer to illustrate wrapping. | ||
| </BODY> | ||
| </HTML> |
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
I think you want
debug_colorlocal variable just likedebug_border.