Closed Bug 1362843 Opened 8 years ago Closed 8 years ago

Stylo: Add bindings for Servo-side setting of nsStyleGridTemplate

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: waffles, Assigned: waffles)

References

Details

Attachments

(1 file)

This is the final piece of grid-* longhands.
I'd like to review this in the context of how these functions will be called from the Servo side. Can you push that patch too?
Flags: needinfo?(wafflespeanut)
Comment on attachment 8865197 [details] Bug 1362843 - Add bindings for StyleGridTemplate and nsTArray<nsString>; https://reviewboard.mozilla.org/r/136868/#review139898 ::: layout/style/ServoBindings.h:334 (Diff revision 1) > // > // Important note: Only valid for POD types, since destructors won't be run > // otherwise. This is ensured with rust traits for the relevant structs. > void Gecko_ClearPODTArray(void* array, size_t elem_size, size_t elem_align); > > +void Gecko_ResizeTArrayForStrings(nsTArray<nsString>* array, uint32_t length); I have a feeling there might be some issue with using templated types in these extern "C" functions, since e.g. with Gecko_EnsureStyleTransitionArrayLength we use void*. Check with Manish or Emilio, and change if so. ::: layout/style/ServoBindings.cpp:1332 (Diff revision 1) > + aValue->mMinTrackSizingFunctions.SetLength(aTrackSizes); > + aValue->mMaxTrackSizingFunctions.SetLength(aTrackSizes); > + aValue->mLineNameLists.SetLength(aTrackSizes + 1); > +} > + > +void Gecko_ResizeTArrayForStrings(nsTArray<nsString>* aArray, uint32_t aLength) { Nit: "{" on new line.
Attachment #8865197 - Flags: review?(cam) → review+
Yeah, I think it'll be a problem on windows, but you can use a typedef instead I think :)
Comment on attachment 8865197 [details] Bug 1362843 - Add bindings for StyleGridTemplate and nsTArray<nsString>; https://reviewboard.mozilla.org/r/136868/#review140034
Attachment #8865197 - Flags: review?(xidorn+moz) → review+
It's now using a wrapper struct (suggested by Xidorn).
Flags: needinfo?(wafflespeanut)
Pushed by ecoal95@gmail.com: https://hg.mozilla.org/integration/autoland/rev/404075957700 Add bindings for StyleGridTemplate and nsTArray<nsString>; r=heycam,xidorn
This also added some hazards to the build: [27.31s] #116 Analyzing Gecko_SetStyleGridTemplateArrayLengths ... Error: Field write nsTArrayHeader.mLength Location: _ZN13nsTArray_baseI27nsTArrayInfallibleAllocator25nsTArray_CopyWithMemutilsE9ShiftDataIS0_EEvmmmmm$void nsTArray_base<Alloc, Copy>::ShiftData(nsTArray_base<Alloc, Copy>::index_type, nsTArray_base<Alloc, Copy>::size_type, nsTArray_base<Alloc, Copy>::size_type, nsTArray_base<Alloc, Copy>::size_type, size_t) [with ActualAlloc = nsTArrayInfallibleAllocator; Alloc = nsTArrayInfallibleAllocator; Copy = nsTArray_CopyWithMemutils; nsTArray_base<Alloc, Copy>::index_type = long unsigned int; nsTArray_base<Alloc, Copy>::size_type = long unsigned int; size_t = long unsigned int] @ obj-analyzed/dist/include/nsTArray-inl.h#259 ### SafeArguments: <arg2> Stack Trace: _ZN13nsTArray_ImplI8nsTArrayI8nsStringE27nsTArrayInfallibleAllocatorE16RemoveElementsAtEmm$void nsTArray_Impl<E, Alloc>::RemoveElementsAt(nsTArray_Impl<E, Alloc>::index_type, nsTArray_Impl<E, Alloc>::size_type) [with E = nsTArray<nsString>; Alloc = nsTArrayInfallibleAllocator; nsTArray_Impl<E, Alloc>::index_type = long unsigned int; nsTArray_Impl<E, Alloc>::size_type = long unsigned int] @ obj-analyzed/dist/include/nsTArray.h#2057 _ZN13nsTArray_ImplI8nsTArrayI8nsStringE27nsTArrayInfallibleAllocatorE14TruncateLengthEm$void nsTArray_Impl<E, Alloc>::TruncateLength(nsTArray_Impl<E, Alloc>::size_type) [with E = nsTArray<nsString>; Alloc = nsTArrayInfallibleAllocator; nsTArray_Impl<E, Alloc>::size_type = long unsigned int] @ obj-analyzed/dist/include/nsTArray.h#1866 _ZN13nsTArray_ImplI8nsTArrayI8nsStringE27nsTArrayInfallibleAllocatorE9SetLengthIS3_EENT_10ResultTypeEm$typename ActualAlloc::ResultType nsTArray_Impl<E, Alloc>::SetLength(nsTArray_Impl<E, Alloc>::size_type) [with ActualAlloc = nsTArrayInfallibleAllocator; E = nsTArray<nsString>; Alloc = nsTArrayInfallibleAllocator; typename ActualAlloc::ResultType = void; nsTArray_Impl<E, Alloc>::size_type = long unsigned int] @ obj-analyzed/dist/include/nsTArray.h#1844 Gecko_SetStyleGridTemplateArrayLengths @ layout/style/ServoBindings.cpp#1329 [27.32s] #117 Analyzing Gecko_ResizeTArrayForStrings ... Error: Field write nsTArrayHeader.mLength Location: _ZN13nsTArray_baseI27nsTArrayInfallibleAllocator25nsTArray_CopyWithMemutilsE9ShiftDataIS0_EEvmmmmm$void nsTArray_base<Alloc, Copy>::ShiftData(nsTArray_base<Alloc, Copy>::index_type, nsTArray_base<Alloc, Copy>::size_type, nsTArray_base<Alloc, Copy>::size_type, nsTArray_base<Alloc, Copy>::size_type, size_t) [with ActualAlloc = nsTArrayInfallibleAllocator; Alloc = nsTArrayInfallibleAllocator; Copy = nsTArray_CopyWithMemutils; nsTArray_base<Alloc, Copy>::index_type = long unsigned int; nsTArray_base<Alloc, Copy>::size_type = long unsigned int; size_t = long unsigned int] @ obj-analyzed/dist/include/nsTArray-inl.h#259 ### SafeArguments: aCount Stack Trace: _ZN13nsTArray_baseI27nsTArrayInfallibleAllocator25nsTArray_CopyWithMemutilsE13InsertSlotsAtIS0_EEbmmmm$bool nsTArray_base<Alloc, Copy>::InsertSlotsAt(nsTArray_base<Alloc, Copy>::index_type, nsTArray_base<Alloc, Copy>::size_type, nsTArray_base<Alloc, Copy>::size_type, size_t) [with ActualAlloc = nsTArrayInfallibleAllocator; Alloc = nsTArrayInfallibleAllocator; Copy = nsTArray_CopyWithMemutils; nsTArray_base<Alloc, Copy>::index_type = long unsigned int; nsTArray_base<Alloc, Copy>::size_type = long unsigned int; size_t = long unsigned int] @ obj-analyzed/dist/include/nsTArray-inl.h#298 _ZN13nsTArray_ImplI8nsString27nsTArrayInfallibleAllocatorE16InsertElementsAtIS1_EEPS0_mm$nsTArray_Impl<E, Alloc>::elem_type* nsTArray_Impl<E, Alloc>::InsertElementsAt(nsTArray_Impl<E, Alloc>::index_type, nsTArray_Impl<E, Alloc>::size_type) [with ActualAlloc = nsTArrayInfallibleAllocator; E = nsString; Alloc = nsTArrayInfallibleAllocator; nsTArray_Impl<E, Alloc>::elem_type = nsString; nsTArray_Impl<E, Alloc>::index_type = long unsigned int; nsTArray_Impl<E, Alloc>::size_type = long unsigned int] @ obj-analyzed/dist/include/nsTArray.h#1904 _ZN13nsTArray_ImplI8nsString27nsTArrayInfallibleAllocatorE9SetLengthIS1_EENT_10ResultTypeEm$typename ActualAlloc::ResultType nsTArray_Impl<E, Alloc>::SetLength(nsTArray_Impl<E, Alloc>::size_type) [with ActualAlloc = nsTArrayInfallibleAllocator; E = nsString; Alloc = nsTArrayInfallibleAllocator; typename ActualAlloc::ResultType = void; nsTArray_Impl<E, Alloc>::size_type = long unsigned int] @ obj-analyzed/dist/include/nsTArray.h#1841 Gecko_ResizeTArrayForStrings @ layout/style/ServoBindings.cpp#1334
Summary: Add bindings for Servo-side setting of nsStyleGridTemplate → Stylo: Add bindings for Servo-side setting of nsStyleGridTemplate
Reopened in bug 1363664
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Flags: needinfo?(wafflespeanut)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: