Skip to content
Permalink
Browse files

style: Fix nsStyleBorder::mBorderColor for GCC.

GCC doesn't like StyleComplexColor with constructor in an anonymous
struct in an anonymous union.  Replace the use of a union to access
`mBorder[..]Color` fields as an array with an accessor methods.

Bug: 1465307
Reviewed-by: xidorn
MozReview-Commit-ID: 1Wulh1qKYCZ
  • Loading branch information...
djg authored and emilio committed Jun 5, 2018
1 parent cdbc409 commit 314b14d46ec58ce72d7f28357a847d496510d135
Showing with 1 addition and 9 deletions.
  1. +1 −9 components/style/properties/gecko.mako.rs
@@ -388,17 +388,9 @@ impl ${style_struct.gecko_struct_name} {

<%!
def get_gecko_property(ffi_name, self_param = "self"):
if "mBorderColor" in ffi_name:
return ffi_name.replace("mBorderColor",
"unsafe { *%s.gecko.__bindgen_anon_1.mBorderColor.as_ref() }"
% self_param)
return "%s.gecko.%s" % (self_param, ffi_name)

def set_gecko_property(ffi_name, expr):
if "mBorderColor" in ffi_name:
ffi_name = ffi_name.replace("mBorderColor",
"*self.gecko.__bindgen_anon_1.mBorderColor.as_mut()")
return "unsafe { %s = %s };" % (ffi_name, expr)
return "self.gecko.%s = %s;" % (ffi_name, expr)
%>

@@ -1594,7 +1586,7 @@ fn static_assert() {
self.gecko.mComputedBorder.${side.ident} = self.gecko.mBorder.${side.ident};
}

<% impl_color("border_%s_color" % side.ident, "(mBorderColor)[%s]" % side.index) %>
<% impl_color("border_%s_color" % side.ident, "mBorder%sColor" % side.name) %>

<% impl_non_negative_length("border_%s_width" % side.ident,
"mComputedBorder.%s" % side.ident,

0 comments on commit 314b14d

Please sign in to comment.
You can’t perform that action at this time.