Commit Graph

3105 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
be07c8b3d4 Bug 1410895: Multiple cleanups on top. r=bz
MozReview-Commit-ID: GX3dfmWL083
2017-10-23 16:06:50 +02:00
Emilio Cobos Álvarez
1f5b74dd8f Bug 1410226: Properly compute the insertion point for a display: contents child in an XBL binding. r=mats
MozReview-Commit-ID: DzuGDHZEc1A
2017-10-20 13:42:15 +02:00
Sebastian Hengst
5aa7782308 Backed out changeset f8703e5ad323 (bug 1410226) for failing reftests layout/reftests/forms/legend/shadow-dom.html and layout/reftests/css-display/display-contents-generated-content-2.html. r=backout on a CLOSED TREE 2017-10-20 20:40:01 +02:00
Emilio Cobos Álvarez
9a52a39644 Bug 1410226: Properly compute the insertion point for a display: contents child in an XBL binding. r=mats
MozReview-Commit-ID: DzuGDHZEc1A
2017-10-20 13:42:15 +02:00
Emilio Cobos Álvarez
cc13fe1e02 Bug 1404789: Get the insertion point right when reconstructing direct children of a shadow root. r=bz
MozReview-Commit-ID: 2Xlke5ujt2Q
2017-10-18 19:41:17 +02:00
Emilio Cobos Álvarez
ebc5c657e2 Bug 1404789: Do not assume that we're part of the flattened tree when we get notified in the frame constructor. r=bz
This really also fixes bug 1409136.

MozReview-Commit-ID: 1yL93mgajmS
2017-10-18 14:22:40 +02:00
Emilio Cobos Álvarez
f79b9c95a2 Bug 1404789: Remove shadow tree hacks in the frame constructor. r=bz
Turns out that the patches in bug 1398448 fixed most of the layout stuff.

There's a GeckoRestyleManager assertion in test_shadowroot_style.html about
document mismatches while restyling, which looks scary, but I haven't
investigated (nor plan to, since that code is hopefully going away soon).

MozReview-Commit-ID: 4km5NCr5xp2
2017-10-11 13:51:05 +02:00
Daniel Holbert
3556d55a6b Bug 1373767 part 1: Always make nsMathMLmathBlockFrame a block formatting context. r=bz
(This makes it behave a bit more like a normal CSS block, and it ensures that
it can provide a float manager to its descendants.)

MozReview-Commit-ID: FmnQYjzD2eD
2017-07-13 15:34:20 -07:00
Jim Chen
0fa6e3ebb6 Bug 1357191 - 1. Use Gecko controls for Fennec date/time fields; r=jessica r=nechen
Right now, date/time fields in Fennec appear as regular text fields,
which display the date/time values without formatting. This patch makes
the fields use the Gecko controls, which do support formatting. This
only changes the appearance of the fields; we still display the native
date/time pickers when the fields are tapped on. The reset button is
hidden in the controls because the Fennec date/time picker provides
a separate "clear" button.

MozReview-Commit-ID: 75QyKmolNuf
2017-10-12 12:20:14 -04:00
Mats Palmgren
3c0eeea532 Bug 1381134 - Ensure we're using the correct frame for the :after/:before references. r=emilio
MozReview-Commit-ID: BwoRNsXLbPS
2017-10-11 20:21:26 +02:00
Sebastian Hengst
8c189ff51a Backed out 2 changesets (bug 1357191) for frequently failing mochitest dom/html/test/forms/test_input_sanitization.html on Android 4.3 API16+ debug. r=backout
Backed out changeset c6ba568874b0 (bug 1357191)
Backed out changeset 562e7fc9a839 (bug 1357191)
2017-10-10 23:27:21 +02:00
Jim Chen
2b0b2a7f9f Bug 1357191 - 1. Use Gecko controls for Fennec date/time fields; r=jessica r=nechen
Right now, date/time fields in Fennec appear as regular text fields,
which display the date/time values without formatting. This patch makes
the fields use the Gecko controls, which do support formatting. This
only changes the appearance of the fields; we still display the native
date/time pickers when the fields are tapped on. The reset button is
hidden in the controls because the Fennec date/time picker provides
a separate "clear" button.

MozReview-Commit-ID: EBE2U1zL74Q
2017-10-10 12:15:50 -04:00
Nicholas Nethercote
7dbfdaf890 Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP
2017-10-03 09:05:19 +11:00
Emilio Cobos Álvarez
2429634849 Bug 1402442: Properly remove display: contents pseudo-frames. r=mats
MozReview-Commit-ID: 4pjVLQfv3YR
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-25 18:25:29 +02:00
Emilio Cobos Álvarez
709ea27b56 Bug 1404324: Use the placeholder state to remove out-of-flows that aren't real descendants of the destruction root. r=bz
Using the style of the frame can mess things up when we reparent them due to
::first-line before removing them.

MozReview-Commit-ID: 3Dt0wF2XRAH
2017-10-04 10:49:41 +02:00
Sebastian Hengst
bc77eea8a5 Backed out changeset cb247c8a0fe5 (bug 1404324) for landing with wrong commit message. r=backout 2017-10-04 10:48:14 +02:00
Emilio Cobos Álvarez
dcb5efedb7 Bug 1404324: Always remove out of flows from the placeholder frame, using its info. r=bz
MozReview-Commit-ID: 3Dt0wF2XRAH
2017-10-04 10:38:34 +02:00
Wes Kocher
cbba752608 Merge inbound to m-c a=merge CLOSED TREE
MozReview-Commit-ID: 3pMHYV9oXLm
2017-09-27 16:51:49 -07:00
Mats Palmgren
feaa9c8873 Bug 1398520 part 4 - Rename nsFormControlFrame to nsCheckboxRadioFrame. r=dholbert
MozReview-Commit-ID: 9nwikVD1cd9
2017-09-27 14:12:00 +02:00
Mats Palmgren
dfec014051 Bug 1398520 part 2 - Remove nsGfxCheckboxControlFrame and nsGfxRadioControlFrame; use nsFormControlFrame instead. r=dholbert
MozReview-Commit-ID: GxnZZXxHDyC
2017-09-27 14:12:00 +02:00
Nicholas Nethercote
9fda5528d2 Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ
2017-09-26 08:33:21 +10:00
Boris Zbarsky
611ff65071 Bug 1401840. Make sure to not end up with infinite recursion when reframing a <body> that has a table pseudo parent coming from the root <html>. r=dholbert
MozReview-Commit-ID: EJiO8Nq5Frb
2017-09-22 23:32:49 -04:00
Boris Zbarsky
6d3f7c19c2 Bug 1400599. Make sure to properly handle removal of the root when the body propagates scrollbar styles to the viewport. r=dholbert
MozReview-Commit-ID: FixsFFtNOfQ
2017-09-18 21:27:23 -04:00
Boris Zbarsky
e48bc77cd9 Bug 1398500 part 2. Make sure that if we start propagating scroll to viewport from a new body element we reframe it as needed. r=dholbert
MozReview-Commit-ID: K54u9NmAlpn
2017-09-15 23:45:06 -04:00
Emilio Cobos Álvarez
6eeff31694 Bug 1397983: Synchronously bind/unbind XBL anonymous content from the bound content's Bind/UnbindFromTree. r=smaug
Doing it off a runnable makes the flattened tree inconsistent until that
runnable runs.

Also add an assert in frame construction that would've caught the first
only-unbind patch.

MozReview-Commit-ID: Hnua3aWSMHi
2017-09-08 14:59:04 +02:00
Emilio Cobos Álvarez
bc608eec3f Bug 1398448: Always insert async when reconstructing ancestors to avoid pathological frame construction cases. r=bz
MozReview-Commit-ID: 5ARTWW9dt7X
2017-09-11 20:41:43 +02:00
Emilio Cobos Álvarez
c8bdb05d35 Bug 1398581: Address followup comments. r=me
MozReview-Commit-ID: CymOOl4VLPj
2017-09-11 17:19:05 +02:00
Emilio Cobos Álvarez
1863a745a8 Bug 1398581: Ensure a first-letter doesn't incorrectly inherit from a first-line. r=heycam
This approach kinda sucks, because we woefully throw away the style context
computed in the case it inherited from a first-line, but it's the easiest thing
I could think of without either making it more inefficient, or threading a
parent style ignoring first-line through ResolvePseudoElementStyle and related
functions.

MozReview-Commit-ID: 3uGuU7dHEnE
2017-09-11 11:15:30 +02:00
Mats Palmgren
4f7c68ce0b Bug 1374112 part 3 - Use AllocateFCItem/FreeFCItem exclusively for allocating FrameConstructionItems. r=dholbert
MozReview-Commit-ID: 7TqWZeTV91J
2017-09-11 00:27:12 +02:00
Mats Palmgren
b96ec795ee Bug 1374112 part 2 - Introduce nsCSSFrameConstructor::AllocateFCItem/FreeFCItem for allocating FrameConstructionItems from an arena/free list. r=dholbert
MozReview-Commit-ID: 5VVhEQOZMlU
2017-09-11 00:27:12 +02:00
Mats Palmgren
f2abf2c852 Bug 1380749 - Retry AdjustAppendParentForAfterContent in case |parentAfterFrame| was a :first-letter frame that we deleted. r=dholbert
MozReview-Commit-ID: 7uIxm4NLHPN
2017-09-09 22:00:54 +02:00
Emilio Cobos Álvarez
ae086b07df Bug 1398041: Make WipeContainingBlock consistent about reconstructing sync or async. r=bz
MozReview-Commit-ID: 1PL3cqfnarB
2017-09-08 09:29:04 +02:00
Emilio Cobos Álvarez
765d70bab1 Bug 1397091: Remove aForReconstruct. r=bz
It's only used to know whether we may potentially need to sync-style the
subtree.

Given with these patches we guarantee that when inserting sync, we have the
style tree up-to-date, we can just check aInsertionKind for the same effect.

MozReview-Commit-ID: ADvcjkGq5hi
2017-09-08 08:56:41 +02:00
Emilio Cobos Álvarez
4ad6950bf0 Bug 1397091: Merge InsertionKind and LazyConstructionAllowed. r=bz
They now map 1-to-1, so there's no reason to keep them separate.

MozReview-Commit-ID: A2Wqa3QNdw8
2017-09-08 08:56:40 +02:00
Emilio Cobos Álvarez
b2106832ac Bug 1397091: Allow calling RecreateFramesForContent with async insertion for non-elements. r=bz
Using the lazy frame construction path instead of the PostRestyleEvent path.

It'd be nice to unify those though...

MozReview-Commit-ID: CwDHZQUBm8e
2017-09-08 08:56:39 +02:00
Emilio Cobos Álvarez
b9cfcd10d7 Bug 1395719: Minimal cleanup when using the accessibility service. r=bz
MozReview-Commit-ID: Enexvl1motp
2017-09-08 08:56:21 +02:00
Emilio Cobos Álvarez
27acb88f02 Bug 1395719: Reconstruct ancestors asynchronously when lazy frame construction is allowed. r=bz
The main purpose of this change is avoiding doing frame construction when the
style tree is not up-to-date.

In the test-case above, for example, a MathML element is changed, and we
schedule style invalidation for it, but another MathML element is inserted, and
we reconstruct the whole thing, using the out-to-date styles from the MathML
element.

There are other cases where this is more problematic than "we just happened to
use out-of-date styles, and we'll restyle eventually", which is when this
reconstruct happens to hit an element which was recently inserted but happened
to lazily construct.

In that case, we haven't even performed initial styling on the element, so we
just panic and crash.

After this the only sync frame construction case remaining when the style tree
is not setup is CharacterDataChanged, which I'll address in bug 1397091.

MozReview-Commit-ID: FSI2Zb34SaZ
2017-09-08 08:56:20 +02:00
Emilio Cobos Álvarez
533f0e367e Bug 1395719: Convert aAllowLazyFrameConstruction to an enum class. r=bz
It's clearer what it means from the callsites.

MozReview-Commit-ID: 7wubYBUQdG0
2017-09-08 08:56:20 +02:00
Emilio Cobos Álvarez
f972bd5a33 Bug 1395719: Make ReconstructDocElementHierarchy take an InsertionKind. r=bz
Otherwise we may unexpectedly sync-construct it.

MozReview-Commit-ID: LybB06img71
2017-09-08 08:56:19 +02:00
Emilio Cobos Álvarez
efb67fdf88 Bug 1396018: Remove REMOVE_DESTROY_FRAMES. r=bz
Instead, explicitly capture the frame tree state on the only caller that passes
this flag around.

This is somewhat wasteful if we end up reconstructing an ancestor frame, since
we'll capture state for it again. But we do that already in most of the cases
(somewhat inconsistently).

MozReview-Commit-ID: CUJsXaVoIpO
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-06 20:30:27 +02:00
Emilio Cobos Álvarez
e33ccef7b7 Bug 1396018: Don't pass aFlags all the way through RecreateFramesForContent. r=bz
We currently use the aFlags argument of ContentRemoved for two purposes:

 (1) To determine when a frame is being removed due to its element being removed
     from the DOM, so we reframe its now-possibly-no-longer-suppressed
     whitespace siblings as needed.

     In other cases, our ContentRemoved call will be followed by a
     ContentInserted call, which will end up doing AddTextItemIfNeeded() to
     generate the relevant textframes if they're necessary.

     Since we only need to tell apart the "DOM removal" and "anything else"
     cases, we don't need to thread the aFlags argument through all the ways
     ContentRemoved can call itself (on an ancestor).

     All those cases should just be treated as "not DOM removal". In particular,
     even if the original call _was_ for a DOM removal, if we convert it to an
     ancestor reframe, which will call ContentInserted on the ancestor as well,
     we don't need to do anything with text siblings of the ancestor.

 (2) To save the frame tree state from DestroyFramesFor, but the frame tree
     state is unconditionally captured on RecreateFramesForContent, so we only
     need to care about it in the original ContentRemoved call.

     Because of that, we can move that to the callsite, patch incoming for that.

MozReview-Commit-ID: Gy5IhUysBlz
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-06 20:30:26 +02:00
Emilio Cobos Álvarez
d494e06a40 Bug 1396018: Remove the hacky removeflags check we do for display: contents and XBL. r=bz
It's not needed afaict.

MozReview-Commit-ID: LeLguGEEdNy
2017-09-06 20:30:26 +02:00
Neerja Pancholi
bb48ee0cd8 Bug 1389029 - Create custom change hint and post restyle event for rowspan, colspan attribute changes. r=dbaron
MozReview-Commit-ID: IwUlgDa3DAj
2017-09-05 13:30:40 -07:00
Louis Chang
67c38c1934 Bug 1352238 Part 1 - Make box construction and layout for radio/checkbox elements work the same on Android as on other platforms. r=mats
MozReview-Commit-ID: NmWepjKDVj
2017-09-05 22:44:24 +08:00
Sebastian Hengst
150f2fb7bc merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: Gsw48p934sI
2017-09-02 10:54:44 +02:00
Wes Kocher
9d60a71a71 Merge m-c to autoland, a=merge
MozReview-Commit-ID: GcHZLNPPNnI
2017-09-01 16:34:14 -07:00
Wes Kocher
465d44242e Merge inbound to central, a=merge
MozReview-Commit-ID: 3JxUEFuinHY
2017-09-01 16:29:10 -07:00
Boris Zbarsky
33016a31e3 Bug 1395715. When recovering letter frames, only do first-line fixup when we have a first-line parent. r=emilio
It turns out, this is the only case in which we need to do the fixup at all.
And this way we don't have to guess based on first-line styles, which may not
match the frame tree (for example if we have a pending style change that we
haven't processed yet).
2017-09-01 11:09:02 -04:00
Emilio Cobos Álvarez
f5e5f14adc Bug 1374235: style: Remove the for reconstruction traversals. r=bholley
One less hack, a few more to go.

MozReview-Commit-ID: 6katL1EGn2U
2017-09-01 18:46:23 +02:00
Emilio Cobos Álvarez
49eacc0e67 Bug 1395351: Don't clobber restyle root flags from frame construction. r=bholley
MozReview-Commit-ID: EsXKiLbYQsY
2017-08-31 21:37:50 +02:00