Commit graph

2807 commits

Author SHA1 Message Date
Kris Maglione
b46bd8b6b0 Bug 1411817: Add do_AddRef overloads for nsCOMPtr<T> and nsRevocableEventPtr<T>. r=froydnj
MozReview-Commit-ID: gEU7whtNHc

--HG--
extra : rebase_source : 6763e6b31be8a3341f968eef057b756fbfe3cbbe
extra : amend_source : da6140fb0559d78b46e80e72e8b6768bf2364fb1
2017-10-25 19:46:50 -07:00
Xidorn Quan
5beed314a8 Bug 1408293 - Eagerly style new children inserted in XUL listbox. r=bz
MozReview-Commit-ID: HLATTkLd1X8

--HG--
extra : rebase_source : 4d90878c5a357a033620cfca2d4c69f56f8cfc32
2017-10-25 18:00:54 +11:00
Emilio Cobos Álvarez
3f918ff3a0 Bug 1410895: Multiple cleanups on top. r=bz
MozReview-Commit-ID: GX3dfmWL083

--HG--
extra : rebase_source : 5ed1b625356d7f561559747fae30f2342459538a
2017-10-23 16:06:50 +02:00
Emilio Cobos Álvarez
650a64145b Bug 1410226: Properly compute the insertion point for a display: contents child in an XBL binding. r=mats
MozReview-Commit-ID: DzuGDHZEc1A

--HG--
extra : rebase_source : 59bde9e85e843bd7ce2ee5167b10fcef5dd4d39b
2017-10-20 13:42:15 +02:00
Sebastian Hengst
05cc4b82d9 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
--HG--
extra : amend_source : 73fc264f71697cc56520b580c90ca949650e88ba
2017-10-20 20:40:01 +02:00
Emilio Cobos Álvarez
8074d54110 Bug 1410226: Properly compute the insertion point for a display: contents child in an XBL binding. r=mats
MozReview-Commit-ID: DzuGDHZEc1A

--HG--
extra : rebase_source : 5591e74ccbb830017c0b34081d60335ba95e0be8
2017-10-20 13:42:15 +02:00
Emilio Cobos Álvarez
b6274da28b Bug 1404789: Get the insertion point right when reconstructing direct children of a shadow root. r=bz
MozReview-Commit-ID: 2Xlke5ujt2Q

--HG--
extra : rebase_source : 8289fd14efaf941a46e339919ae04c16f4de2840
2017-10-18 19:41:17 +02:00
Emilio Cobos Álvarez
cd049c28b9 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

--HG--
extra : rebase_source : dbbf41fc12f411a1fd949700f3eceb084d4853eb
2017-10-18 14:22:40 +02:00
Emilio Cobos Álvarez
96fe568618 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

--HG--
extra : rebase_source : 32eef715d6509f25449edb967dee8ac6f18c5f84
2017-10-11 13:51:05 +02:00
Daniel Holbert
8ee548e499 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

--HG--
extra : rebase_source : 6e02bff6786fe4e4146339908c5f2e1becd3a929
2017-07-13 15:34:20 -07:00
Jim Chen
ea127a6715 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
9c667d893f 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
592a737256 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
ee5f9c3e19 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
d225f7151b 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

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Emilio Cobos Álvarez
7ae6330744 Bug 1402442: Properly remove display: contents pseudo-frames. r=mats
MozReview-Commit-ID: 4pjVLQfv3YR
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

--HG--
extra : rebase_source : 641946b30a36ab407b1940d8b42967fa92083073
2017-09-25 18:25:29 +02:00
Emilio Cobos Álvarez
660ab8f549 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
0ba56b9c7d 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
ae652b0b37 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
61c098eae7 Merge inbound to m-c a=merge CLOSED TREE
MozReview-Commit-ID: 3pMHYV9oXLm

--HG--
rename : dom/base/nsReferencedElement.cpp => dom/base/IDTracker.cpp
rename : dom/base/nsReferencedElement.h => dom/base/IDTracker.h
2017-09-27 16:51:49 -07:00
Mats Palmgren
d9d785d520 Bug 1398520 part 4 - Rename nsFormControlFrame to nsCheckboxRadioFrame. r=dholbert
MozReview-Commit-ID: 9nwikVD1cd9

--HG--
rename : layout/forms/nsFormControlFrame.cpp => layout/forms/nsCheckboxRadioFrame.cpp
rename : layout/forms/nsFormControlFrame.h => layout/forms/nsCheckboxRadioFrame.h
2017-09-27 14:12:00 +02:00
Mats Palmgren
e377f37e6e 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
dfd3b7e7aa 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

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Boris Zbarsky
f0ee8b8b01 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
53bb40c960 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
8e81160ff3 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
37df721a48 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

--HG--
extra : rebase_source : 2781e3b0a3f28b6b6a620902e7414dfe682fba51
2017-09-08 14:59:04 +02:00
Emilio Cobos Álvarez
f2b7e3f5a3 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
2a9742d4b6 Bug 1398581: Address followup comments. r=me
MozReview-Commit-ID: CymOOl4VLPj
2017-09-11 17:19:05 +02:00
Emilio Cobos Álvarez
762a3ec064 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
f03f683f75 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
062e1c6efa 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
d547785f05 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
6ad66f91a9 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
2776c6f693 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
635b115223 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
6d9f8e1c9e 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
6d5e03f58b 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
8d92630b75 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
933ecf7682 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
02a3b2a06b 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
6ed36d94e6 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
f4c424fbc9 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
f4bd95813a 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
b12bf0cae2 Bug 1389029 - Create custom change hint and post restyle event for rowspan, colspan attribute changes. r=dbaron
MozReview-Commit-ID: IwUlgDa3DAj

--HG--
extra : rebase_source : e99732f1173eba16f2cf42453c6418d72591ce7e
2017-09-05 13:30:40 -07:00
Louis Chang
057601eaa6 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

--HG--
extra : rebase_source : b8e1c2684672c3426708099225342ebae152b3f4
2017-09-05 22:44:24 +08:00
Sebastian Hengst
4d0bad92dd merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: Gsw48p934sI
2017-09-02 10:54:44 +02:00
Wes Kocher
8b84853ed6 Merge m-c to autoland, a=merge
MozReview-Commit-ID: GcHZLNPPNnI
2017-09-01 16:34:14 -07:00
Wes Kocher
5f157c17dc Merge inbound to central, a=merge
MozReview-Commit-ID: 3JxUEFuinHY
2017-09-01 16:29:10 -07:00
Boris Zbarsky
264b2245fd 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