Граф коммитов

152 Коммитов

Автор SHA1 Сообщение Дата
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
Sebastian Hengst 3c8747ae61 merge mozilla-central to autoland. r=merge a=merge 2017-10-07 10:52:29 +02:00
Tobias Schneider 7c9837e0e8 Bug 1316277 - Move intersection observer list from DOMSlots to a property. r=mrbkap
--HG--
extra : rebase_source : fcaa7d31e0a99ad666e0091c56cd9858e3afcc4b
2017-10-05 20:42:55 -07:00
Xidorn Quan e9accd246b Bug 1406277 - Completely remove xml:base for style attribute. r=bz
This commit removes:
* layout.css.style-attr-with-xml-base.disabled pref
* deprecation XMLBaseAttributeForStyleAttr
* code path for getting base URI of style attr considering xml:base

MozReview-Commit-ID: 1w96eqhHPab

--HG--
extra : rebase_source : 95e33da698ce0cfc9a44de8bc0d63c3fa4634644
2017-10-06 15:45:33 +11:00
Bobby Holley d429e49ba4 Bug 1404316 - Use the nsContentUtils machinery for identifying document-level NAC in GetFlattenedTreeParentNodeInternal. r=emilio
MozReview-Commit-ID: 74UMBeZBZcw
2017-10-01 14:08:18 -07:00
Sebastian Hengst 5afa7795ae Backed out changeset e6663f10c42b (bug 1404316) for crashing in devtools/server/tests/browser/browser_canvasframe_helper_04.js on Windows 7 debug with non-e10s builds. r=backout 2017-10-01 10:08:17 +02:00
Bobby Holley 801a3f2a8b Bug 1404316 - Use the nsContentUtils machinery for identifying document-level NAC in GetFlattenedTreeParentNodeInternal. r=emilio
MozReview-Commit-ID: 74UMBeZBZcw
2017-09-30 21:17:33 -07:00
Phil Ringnalda 7546edeeec Backed out 2 changesets (bug 1404316) for debug build bustage
Backed out changeset 555a9dafe460 (bug 1404316)
Backed out changeset e939fa11b68c (bug 1404316)

MozReview-Commit-ID: 5ek3To3HsWo
2017-09-30 21:09:30 -07:00
Bobby Holley f6ee2b8e9b Bug 1404316 - Use the nsContentUtils machinery for identifying document-level NAC in GetFlattenedTreeParentNodeInternal. r=emilio
MozReview-Commit-ID: 74UMBeZBZcw
2017-09-30 20:02:39 -07: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
Jessica Jong 60f43f2bbd Bug 1392970 - Part 1: Make CustomElementDefinition ref-counted and put it in CustomElementData. r=smaug
MozReview-Commit-ID: DIQN3JFxkT8
2017-09-25 02:46:00 -04:00
Olli Pettay c80e124562 Bug 1396584 - Remove support for multiple ShadowRoots, r=mrbkap
--HG--
extra : rebase_source : 2bb600ed1ffd35c195617a7eb70d0ba847a46898
2017-09-25 18:09:26 +03:00
Emilio Cobos Álvarez 6761fabaa9 Bug 1400936: Only tear down the servo data in SetXBLInsertionParent if the parent actually changed. r=bholley
This is the reason similar assertion failures can't be reproduced with elements
and stuff like fieldset and form validity changes.

nsBindingManager::ContentRemoved calls SetXBLInsertionParent, which clears all
the Servo data from the subtree eagerly, which is a waste when the actual
binding parent is the same (null).

MozReview-Commit-ID: A5wLKfD4OTL
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-23 04:49:09 +02:00
Catalin Badea 516b5546f4 Bug 1395945 - Remove child array getter. r=ehsan 2017-09-01 22:13:49 +01:00
Emilio Cobos Álvarez d834736e8a Bug 1394935: Return the document as the flattened tree parent of doc-level NAC. r=bholley
MozReview-Commit-ID: 1m3BBU14MNe

--HG--
extra : rebase_source : 96ce6649d2d2df9c9523ec0a72740683db4929c4
2017-08-31 20:05:03 +02:00
Nathan Froyd bd0f2fccab Bug 1393592 - manually de-virtualize nsIWeakReference::QueryReferent; r=ehsan
The virtual call to this method shows up in profiles, and therefore
would be nice to avoid if possible.  We can do that by making
nsIWeakReference hold the weak reference itself and therefore
implementing a non-virtual QueryReferent method.
2017-08-25 13:48:29 -04:00
Nicholas Nethercote 7e120ce35e Bug 1393636 (part 3) - Pass nsWindowSizes to more AddSizeOf*() functions. r=heycam.
This is a purely non-functional plumbing change. Instead of passing a
SizeOfState and an nsStyleSizes a bunch of places, we pass an nsWindowSizes,
which contains both of them.

This is a necessary precursor for the next patch.

MozReview-Commit-ID: Ek03wDM50rB

--HG--
extra : rebase_source : 7b05708bd21dc4e3812ea041647fa74bb413d0b9
2017-08-25 14:47:54 +10:00
btian 2683456670 Bug 1384661 - Part 2: Add class nsParentNodeChildContentList. r=smaug 2017-08-21 16:11:56 +08:00
btian 05a1fd9f6a Bug 1384661 - Part 1: Rename class nsChildContentList to nsAttrChildContentList. r=smaug 2017-08-11 10:12:17 +08:00
Olli Pettay 6e1dc494d2 Bug 1391423, add a nursery for purple buffer to allow faster addref/release on the main thread, r=mccr8
--HG--
extra : rebase_source : 4dcb8af2d3f2518ab0fd00b65fbf1d0096d8e810
2017-08-22 00:01:47 +03:00
Masayuki Nakano b11e66f8da Bug 1388004 - part1: Make nsContentUtils::GetHTMLEditor() return HTMLEditor* rather than nsIEditor* r=smaug
nsContentUtils::GetHTMLEditor() currently returns nsIEditor* since editor of doc shell may be any type of editors such as TextEditor or editor object which is implemented by JS.  However, nsIEditor is now a builtin class.  So, it can return HTMLEditor.

MozReview-Commit-ID: 3YoFOplZa7W

--HG--
extra : rebase_source : 46f42d23babd64bf0a5003e66e8fe3b9e0bd7166
2017-08-07 16:33:59 +09:00
Nicholas Nethercote 57c26c9834 Bug 1387956 - Overhaul ComputedValues measurement, and add style structs measurement. r=bholley.
This patch moves measurement of ComputedValues objects from Rust to C++.
Measurement now happens (a) via DOM elements and (b) remaining elements via
the frame tree. Likewise for the style structs hanging off ComputedValues
objects.

Here is an example of the output.

> ├──27,600,448 B (26.49%) -- active/window(https://en.wikipedia.org/wiki/Barack_Obama)
> │  ├──12,772,544 B (12.26%) -- layout
> │  │  ├───4,483,744 B (04.30%) -- frames
> │  │  │   ├──1,653,552 B (01.59%) ── nsInlineFrame
> │  │  │   ├──1,415,760 B (01.36%) ── nsTextFrame
> │  │  │   ├────431,376 B (00.41%) ── nsBlockFrame
> │  │  │   ├────340,560 B (00.33%) ── nsHTMLScrollFrame
> │  │  │   ├────302,544 B (00.29%) ── nsContinuingTextFrame
> │  │  │   ├────156,408 B (00.15%) ── nsBulletFrame
> │  │  │   ├─────73,024 B (00.07%) ── nsPlaceholderFrame
> │  │  │   ├─────27,656 B (00.03%) ── sundries
> │  │  │   ├─────23,520 B (00.02%) ── nsTableCellFrame
> │  │  │   ├─────16,704 B (00.02%) ── nsImageFrame
> │  │  │   ├─────15,488 B (00.01%) ── nsTableRowFrame
> │  │  │   ├─────13,776 B (00.01%) ── nsTableColFrame
> │  │  │   └─────13,376 B (00.01%) ── nsTableFrame
> │  │  ├───3,412,192 B (03.28%) -- servo-style-structs
> │  │  │   ├──1,288,224 B (01.24%) ── Display
> │  │  │   ├────742,400 B (00.71%) ── Position
> │  │  │   ├────308,736 B (00.30%) ── Font
> │  │  │   ├────226,512 B (00.22%) ── Background
> │  │  │   ├────218,304 B (00.21%) ── TextReset
> │  │  │   ├────214,896 B (00.21%) ── Text
> │  │  │   ├────130,560 B (00.13%) ── Border
> │  │  │   ├─────81,408 B (00.08%) ── UIReset
> │  │  │   ├─────61,440 B (00.06%) ── Padding
> │  │  │   ├─────38,176 B (00.04%) ── UserInterface
> │  │  │   ├─────29,232 B (00.03%) ── Margin
> │  │  │   ├─────21,824 B (00.02%) ── sundries
> │  │  │   ├─────20,080 B (00.02%) ── Color
> │  │  │   ├─────20,080 B (00.02%) ── Column
> │  │  │   └─────10,320 B (00.01%) ── Effects
> │  │  ├───2,227,680 B (02.14%) -- computed-values
> │  │  │   ├──1,182,928 B (01.14%) ── non-dom
> │  │  │   └──1,044,752 B (01.00%) ── dom
> │  │  ├───1,500,016 B (01.44%) ── text-runs
> │  │  ├─────492,640 B (00.47%) ── line-boxes
> │  │  ├─────326,688 B (00.31%) ── frame-properties
> │  │  ├─────301,760 B (00.29%) ── pres-shell
> │  │  ├──────27,648 B (00.03%) ── pres-contexts
> │  │  └─────────176 B (00.00%) ── style-sets

The 'servo-style-structs' and 'computed-values' sub-trees are new. (Prior to
this patch, ComputedValues under DOM elements were tallied under the the
'dom/element-nodes' sub-tree, and ComputedValues not under DOM element were
ignored.) 'servo-style-structs/sundries' aggregates all the style structs that
are smaller than 8 KiB.

Other notable things done by the patch are as follows.

- It significantly changes the signatures of the methods measuring nsINode and
  its subclasses, in order to handle the tallying of style structs separately
  from element-nodes. Likewise for nsIFrame.

- It renames the 'layout/style-structs' sub-tree as
  'layout/gecko-style-structs', to clearly distinguish it from the new
  'layout/servo-style-structs' sub-tree.

- It adds some FFI functions to access various Rust-side data structures from
  C++ code.

- There is a nasty hack used twice to measure Arcs, by stepping backwards from
  an interior pointer to a base pointer. It works, but I want to replace it
  with something better eventually. The "XXX WARNING" comments have details.

- It makes DMD print a line to the console if it sees a pointer it doesn't
  recognise. This is useful for detecting when we are measuring an interior
  pointer instead of a base pointer, which is bad but easy to do when Arcs are
  involved.

- It removes the Rust code for measuring CVs, because it's now all done on the
  C++ side.

MozReview-Commit-ID: BKebACLKtCi

--HG--
extra : rebase_source : 4d9a8c6b198a0ff025b811759a6bfa9f33a260ba
2017-08-11 16:37:33 +10:00
Xidorn Quan 8c243b6260 Bug 1383780 - Null-check return value of SVGUseElement::GetContentURLData before returning. r=bz
MozReview-Commit-ID: 19X22AVQ4Gg

--HG--
extra : rebase_source : 2fa532cec7931603540553fc1bf51787f52d7647
2017-08-02 12:07:58 +10:00
Sebastian Hengst 5e6e6641de Backed out changeset 5dd6f04aea59 (bug 1383780) for failing crashtests on stylo. r=backout on a CLOSED TREE 2017-08-02 13:27:08 +02:00
Xidorn Quan 61c08a894b Bug 1383780 - Null-check return value of SVGUseElement::GetContentURLData before returning. r=bz
MozReview-Commit-ID: 19X22AVQ4Gg

--HG--
extra : rebase_source : 35ed42fc87eea22fa62f90e997ea90ad41e7f9ea
2017-08-02 12:07:58 +10:00
Nicholas Nethercote 49eb219ff5 Bug 1383982 (attempt 2) - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
--HG--
extra : rebase_source : 7075f9570a4262158351ce9ac3ca8360ea4d5394
2017-07-28 20:10:04 +10:00
Sebastian Hengst 9077ac8886 Backed out changeset a57d8f30d1bf (bug 1383982) for build bustage at nsGlobalWindow.cpp:13826: 'class nsWindowSizes' has no member named 'mMallocSizeOf'. r=backout 2017-07-28 09:50:48 +02:00
Nicholas Nethercote 5c3abe8aab Bug 1383982 - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
All the SizeOf{In,Ex}cludingThis() functions take a MallocSizeOf function
which measures memory blocks. This patch introduces a new type, SizeOfState,
which includes a MallocSizeOf function *and* a table of already-measured
pointers, called SeenPtrs. This gives us a general mechanism to measure
graph-like data structures, by recording which nodes have already been
measured. (This approach is used in a number of existing reporters, but not in
a uniform fashion.)

The patch also converts the window memory reporting to use SizeOfState in a lot
of places, all the way through to the measurement of Elements. This is a
precursor for bug 1383977 which will measure Stylo elements, which involve
Arcs.

The patch also converts the existing mAlreadyMeasuredOrphanTrees table in the
OrphanReporter to use the new mechanism.

--HG--
extra : rebase_source : 2c23285f8b6c3b667560a9d14014efc4633aed51
2017-07-28 15:03:44 +10:00
Ehsan Akhgari 585393f54b Bug 1382914 - Store the hashtable of ancestor ranges in the node slots instead of in a property in order to speed up access to it; r=smaug 2017-07-25 13:01:16 -04:00
John Dai b6b41eca6c Bug 1315885 - Part 4: Implement callback reaction for custom element reactions. r=wchen
--HG--
extra : rebase_source : 0ccd628ce1f0904bf2d412ade2710c6e1203641e
2017-07-18 20:30:00 -04:00
Olli Pettay 0738714332 Bug 1377993 - Make node slots less memory hungry in common cases. r=peterv
MozReview-Commit-ID: Lhr1UsCrRTs
2017-07-18 00:25:49 +02:00
Bobby Holley b2fd3f821c Bug 1380106 - Drop style data in DestroyContent. r=heycam,r=bz
MozReview-Commit-ID: 9ydkvlDA9oS
2017-07-12 14:11:41 -07:00
Masatoshi Kimura b515c9c804 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : fdae0046f882d47fb539a7f882364e5c5caafdcd
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Sebastian Hengst dfc1ad2562 Backed out changeset 7235d05662b0 (bug 1373984) for Android bustage. r=backout on a CLOSED TREE 2017-06-25 18:30:13 +02:00
Masatoshi Kimura 2e04751921 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : a84ab644f52e68676b45f112ff69f868d89f6177
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Wes Kocher e02435a31e Backed out changeset 77af189b5c49 (bug 1373984) for build bustage in nsHtml5Parser.cpp a=backout CLOSED TREE
MozReview-Commit-ID: 6kBmU71j2To
2017-06-25 05:10:14 -07:00
Masatoshi Kimura 241039fd97 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : 09da1685795583513bf019d61c58230c2c4d298d
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Masayuki Nakano 9f1aec970a Bug 1374207 - part4: Element classes should use TextEditor class instead of nIEditor r=smaug
Unfortunately, nsGenericHTMLElement::GetAssociatedEditor() cannot use concrete classes because it may return nsIEditor which is set via nsIDocShell.editor.  The editor set to nsIDocShell may be implemented by JS since nsIEditor isn't marked as builtinclass.

MozReview-Commit-ID: 6GY9LOYp4hM

--HG--
extra : rebase_source : 3e0464067b30daf8254805458c5358d7ea644be8
2017-06-22 15:21:31 +09:00
Emilio Cobos Álvarez f6dc661b5b Bug 1370802: Parse lang attributes as atoms. r=heycam
MozReview-Commit-ID: Cnq3wB7aVB1

--HG--
extra : rebase_source : fa0252b78381bf023ab08bf2d9fd13d4c0ed57a1
2017-06-15 21:48:26 +02:00
John Dai 005cba50ea Bug 556743 - Implement the labels attribute. r=smaug 2017-06-15 20:04:00 -04:00
Olli Pettay 1c41ba7c1e Bug 1367552 - Use IdleDispatch for ContentUnbinder , r=ehsan
--HG--
extra : rebase_source : 7575c7db087334f239eec517666a7ddd8061a668
2017-05-24 18:06:32 -04:00
Kirk Steuber 7fdb378650 Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz
Currently, attribute and child arrays (implemented in dom/base/nsAttrAndChildArray.h) start out empty. When cloning, the array ends up being resized multiple times in order to add the attributes and children that are being cloned from the original node. This would be quicker if the array was initialized to the correct size in the first place so that resizes are not necessary.

However, preallocating space for children is only necessary when performing a deep clone. Therefore, an additional parameter is being added to the Clone, CopyInnerTo, and CloneDocHelper methods to indicate whether preallocation of children should happen. Attributes are copied either way, so that part of the array is preallocated in both cases.

MozReview-Commit-ID: 3iVezeAKXnI

--HG--
extra : rebase_source : 9c3deec6d7aafd6411044d623d4863637b45fd58
2017-04-20 12:57:48 -07:00
Emilio Cobos Álvarez e0e2e3ceb4 Bug 1331047: Return the correct flattened tree parent for ::before and ::after of the root element. r=bholley
MozReview-Commit-ID: LEuf9dyknh4
2017-04-27 17:09:27 +02:00
Boris Zbarsky 14dfe4c256 Bug 1356498. Change nsDocument's unlink to unbind/remove its kids the same way other places (including FragmentOrElement's unlink) do. r=mystor
This prevents us from trying to re-set the base URI to the href of a <base> element that's being unlinked.
2017-04-18 20:56:45 -04:00
Xidorn Quan ea9834babb Bug 1343964 part 4 - Have document and svg:use element own URLExtraData. r=bholley,bz
MozReview-Commit-ID: 8451L5qJvEx

--HG--
extra : rebase_source : caa9b3ccd786563a59dc39fe7c23842928c173cc
2017-04-06 16:51:29 +10:00
Xidorn Quan 8b3894a4e8 Bug 1349059 - Replace XMLBaseAttributeWithStyledElement with XMLBaseAttributeForStyleAttr for a more accurate measurement. r=bz
MozReview-Commit-ID: DXILBM79r2Q

--HG--
extra : rebase_source : 526885b04879da7b244f76ff4ef9aa40305d1c81
2017-03-21 11:32:19 +11:00
Manish Goregaokar 16276b38cd Bug 1341086 - Part 3: stylo: Add thread-safe version of nsStyleUtil::IsSignificantChild(); r=emilio
MozReview-Commit-ID: 3l8cNwDHKFl

--HG--
extra : rebase_source : af2ed1c345991c894d482193a1fb654bd6a7ba69
2017-03-16 14:10:22 -07:00
Edgar Chen 00f084fb1b Bug 1347634 - GetCustomElementData and SetCustomElementData don't need to be virtual; r=smaug 2017-03-16 12:21:12 +08:00
Xidorn Quan 6eb58892f8 Bug 1345343 - Add a pref to turn off effect of xml:base on style attribute. r=bz
MozReview-Commit-ID: EzNLxIW0OCv

--HG--
extra : rebase_source : 7c6d1278ed47d35b109bbe3e6305032b7f125fa4
2017-03-10 18:04:34 +11:00
Xidorn Quan 3357d0d06e Bug 1344102 - Add a telemetry for xml:base on styled element. r=bz
MozReview-Commit-ID: 9vqlxDi5KB8

--HG--
extra : rebase_source : 70598eecff0c25e82d25a9bf9f2e36d26bf35648
2017-03-03 14:32:11 +11:00