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

146 Коммитов

Автор SHA1 Сообщение Дата
Andrea Marchesini 6ee7f4e6f3 Bug 1425321 - Renaming nsINode::RemoveChildAt to RemoveChildAt_Deprecated, r=catalinb 2018-01-03 14:01:03 +01:00
Andrea Marchesini 00e79ef07b Bug 1425321 - Renaming nsINode::GetChildAt to GetChildAt_Deprecated, r=catalinb
We want to deprecate nsINode::GetChildAt as the first step of removing DOM node
child array storage. See bug 651120.
2018-01-03 13:59:54 +01:00
Emilio Cobos Álvarez 1cda1ad876 Bug 1427511: Make GetFlattenedTreeParent more straight-forward. r=smaug
Now that accessing nsIContent slots is not a blob of virtual function calls, we
should be able to unify logic here, and speed up the not-so-rare case for
chrome, while keeping the usual case fast.

MozReview-Commit-ID: 87iY5Cbhx4T
2018-01-02 18:00:25 +01:00
Emilio Cobos Álvarez 09c8911ffe Bug 1427001: Stop duplicating slots. r=smaug
MozReview-Commit-ID: Cq647BcOzbe
2017-12-31 13:45:52 +01:00
Boris Zbarsky 06a6d6e207 Bug 1407858 part 1. Give DOMString setter APIs clearer names. r=smaug
The renaming here is like this:

  SetStringBuffer -> SetKnownLiveStringBuffer
  SetEphemeralStringBuffer -> SetStringBuffer
  SetOwnedString -> SetKnownLiveString
  SetOwnedAtom -> SetKnownLiveAtom

This should make it clearer what the lifetime expectations are on the caller side.

MozReview-Commit-ID: ERHbB3r6paN
2017-12-22 13:02:51 -05:00
Boris Zbarsky 04324f18ad Bug 1424474 part 3. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag
MozReview-Commit-ID: IjUEG5xwn5
2017-12-20 17:43:18 -05:00
Narcis Beleuzu edb8ba34eb Backed out 2 changesets (bug 1424474) for mochitest failures on test_bug494328.html r=backout on a CLOSED TREE
Backed out changeset 39d5991f02ba (bug 1424474)
Backed out changeset da3dec2fce06 (bug 1424474)
2017-12-21 02:55:27 +02:00
Boris Zbarsky a2696c3c8a Bug 1424474 part 2. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag 2017-12-20 17:43:18 -05:00
Edgar Chen 5fedbb92b8 Bug 1422197 - Add fast path to get DocGroup in binding code for [CEReactions]; r=smaug
MozReview-Commit-ID: HgbFo9ddr0o

--HG--
extra : rebase_source : 04989782fc7c7ce79e0e65b3dc907c9e174a0809
2017-11-27 16:10:27 +08:00
Boris Zbarsky 887ce3941a Bug 1419270 part 2. Use getter or setter specific NeedsSubjectPrincipal annotations more. r=qdot
MozReview-Commit-ID: KBwjFh3TMUg
2017-12-05 16:03:18 -05:00
Jessica Jong adc29479a2 Bug 1409975 - Part 1: Implementation for assignedNodes. r=smaug
Set and unset assignedNodes properly when slot is added/removed and when
slotables are added/removed/modfied. Note that assigedNodes with
flatten: true is calculated on demand.
2017-12-04 16:06:34 +08:00
Kris Maglione 77ae77c2c9 Bug 1415352: Part 4b - Capture the subject principal in textContent setters. r=bz
This is necessary in order to capture the correct triggering principal for
inline <style> nodes.

MozReview-Commit-ID: 7g1n3bdHVi4

--HG--
extra : rebase_source : eb84775237e662f20112f54b148ef11005746950
2017-11-07 14:01:21 -08:00
btian f8653ddd95 Bug 1384661 - Part 3: Invalidate cached child array when list of children changes. r=smaug
--HG--
extra : rebase_source : 6538742f178b2eb184fc9653b8322931f5a029c5
2017-10-23 15:04:14 +08:00
btian 5c02026b84 Bug 1384661 - Part 1: Rename class nsChildContentList to nsAttrChildContentList. r=smaug
--HG--
extra : rebase_source : a4fe54aa9cf3423fe952391654ae40e3aca3a66f
2017-08-11 10:12:17 +08:00
Emilio Cobos Álvarez dd634e3981 Bug 1411612: Kill nsINode::eCONTENT. r=bz
MozReview-Commit-ID: ESlOqlwhcHI

--HG--
extra : rebase_source : fe6a02469dca1e50c24ba166e15e39160ab4551b
2017-10-25 17:19:11 +02:00
btian 4986b193f1 Bug 1406395 - P3: Backout changeset b679806ce7e3 (bug 1384661 part 1). r=smaug 2017-10-13 12:06:43 +08:00
Nicholas Nethercote f2d1f3b005 Bug 1407117 - Simplify static atom representation. r=froydnj,bz.
Currently nsAtom::mString points to the interior of an nsStringBuffer. For
static atoms this requires the use of nsFakeStringBuffer, which is pretty
gross.

This patch changes things so that nsAtom::mString points to a static char
buffer for static atoms. This simplifies a number of things:

- nsFakeStringBuffer and CheckStaticAtomSizes are no longer needed.

- FakeBufferRefCountHelper is no longer needed.

- nsAtom's constructor for static atoms is simpler.

- RegisterStaticAtoms() is simpler.

On the flip-side, a couple of things get more complicated.

- nsAtom::ToString() treats static and dynamic atoms differently.

- nsAtom::GetStringBuffer() is now only valid for dynamic atoms. This
  function is only used in two places, both involving DOMString, so those
  locations are updated appropriately. This also requires updating some other
  code assigning nsStrings to DOMStrings, because we can't assume that
  nsStrings are shared.

On Linux64 this change reduces the size of the binary by 8752 B, and moves
81968 B from the .data to the .rodata section, where it can be shared between
processes.

--HG--
extra : rebase_source : 0f6fcdec1c525aa66222e208b66a9f9026f69bcb
2017-10-12 10:52:17 +11: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 109bd88bea Bug 1404897: followup: Fixup documentation of nsINode::WithSelectorList. r=me
DONTBUILD since it's comment-only.

MozReview-Commit-ID: 4UOdTuQRx0o
2017-10-05 01:52:09 +02:00
Emilio Cobos Álvarez 4eb5336c9b Bug 1404897: Implement Element.matches using stylo. r=heycam
MozReview-Commit-ID: 7nxYVcweu0W

--HG--
extra : rebase_source : e660504ba8ec2be7d678049000cb76018dc4ba5e
2017-10-02 18:14:15 +02:00
Sebastian Hengst d90f0a5f6d Backed out changeset cfc393773f0d (bug 1404897) 2017-10-04 12:55:11 +02:00
Emilio Cobos Álvarez ff89c00970 Bug 1404897: Implement Element.matches using stylo. r=heycam
MozReview-Commit-ID: 7nxYVcweu0W

--HG--
extra : rebase_source : 4c816bb774ea7c67262a1e73277e3dbaeec060e8
2017-10-02 18:14:15 +02:00
Sebastian Hengst 000d2b584e Backed out changeset 3833f3700021 (bug 1404897) 2017-10-04 11:24:26 +02:00
Emilio Cobos Álvarez aaadd28724 Bug 1404897: Implement Element.matches using stylo. r=heycam
MozReview-Commit-ID: 7nxYVcweu0W
2017-10-04 11:01:42 +02:00
Catalin Badea 516b5546f4 Bug 1395945 - Remove child array getter. r=ehsan 2017-09-01 22:13:49 +01:00
Boris Zbarsky c73dc94931 Bug 1395701 part 2. Use a linked list, not a hashtable, for registering selection ranges on a node, so the registration will be faster. r=ehsan
Inserting/removing things into a doubly-linked list is much faster than doing
the same with a hashtable.  Selection ranges register themselves on their common
ancestor, but all we do with that in non-debug code is iterate all the ranges
registered.  A doubly-linked list works fine for that.

This adds three words to every range for the LinkedListItem members, but that
should be OK.
2017-09-01 11:13:47 -04:00
Sebastian Hengst 5b321f702f Backed out changeset dd99274926b8 (bug 1395701) for huaf in clipboard suite on Linux x64 asan and M(8), furthermore frequently asserting at LinkedList.h:455. r=backout 2017-09-01 19:29:06 +02:00
Boris Zbarsky dfd04e984c Bug 1395701 part 2. Use a linked list, not a hashtable, for registering selection ranges on a node, so the registration will be faster. r=ehsan
Inserting/removing things into a doubly-linked list is much faster than doing
the same with a hashtable.  Selection ranges register themselves on their common
ancestor, but all we do with that in non-debug code is iterate all the ranges
registered.  A doubly-linked list works fine for that.

This adds three words to every range for the LinkedListItem members, but that
should be OK.
2017-09-01 11:13:47 -04:00
Catalin Badea d074b09d16 Bug 1380367 - Use a node reference as range boundary in nsRange. r=smaug 2017-09-01 11:53:22 +01: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 05a1fd9f6a Bug 1384661 - Part 1: Rename class nsChildContentList to nsAttrChildContentList. r=smaug 2017-08-11 10:12:17 +08:00
Nicholas Nethercote 57d3dfdc07 Bug 1390404 - Use AllChildrenIterator to traverse DOM nodes when memory reporting. r=bholley.
This gets us coverage for anonymous nodes, which are currently missed.

MozReview-Commit-ID: KBOSXloteu6

--HG--
extra : rebase_source : 0f71c027f8bbbb0abd4d9e812b5d7369109e7ebc
2017-08-15 11:12:40 +10:00
Jonathan Watt dba7445f81 Bug 1367214, part 3 - Avoid hashtable lookups in the undisplayed maps for elements that do not have display:none nor display:contents children. r=baku,dholbert
MozReview-Commit-ID: 8HrW5iAqCVK
2017-08-04 19:09:41 +01: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
Bobby Holley 3e308bd38d Bug 1389385 - Rearrange dirty noting to operate on the element rather than the parent. r=emilio
This will allow us to scope restyle roots more tightly.

MozReview-Commit-ID: 2t2lp5sKBHH
2017-08-11 18:18:22 -07:00
Ehsan Akhgari 50fd0b7a62 Bug 1385533 - Reserve space for one pointer in the mMutationObservers array on node slots; r=smaug
This helps avoid allocations for the first mutation observer (for example, Range)
created by a caller.
2017-07-31 17:12:38 -04: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 0abf86be7c Bug 1382914 follow-up: Spell GetExistingCommonAncestorRanges() correctly
Landed on a CLOSED TREE to fix build bustage
2017-07-25 13:37:50 -04: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
Beekill95 463ad1bdff Bug 1362330 - Part 1: Move XPath generation to Node's interface and move all remaining XPathGenerator.jsm functions to FormData. r=mikedeboer, r=smaug
MozReview-Commit-ID: Ej45wPeddtQ
2017-06-15 08:49:17 +07:00
Carsten "Tomcat" Book 2f89ff146f Backed out changeset 9342f0d949f1 (bug 1362330) for failures like nsFocusManager.cpp:1166:31: error: member access into incomplete type 'mozilla::dom::nsIContentParent'
--HG--
extra : rebase_source : f66736599ced81fde3b0f0555bb1f85934ecec54
2017-07-04 09:53:36 +02:00
Beekill95 fd725fa7ce Bug 1362330 - Part 1: Move XPath generation to Node's interface and move all remaining XPathGenerator.jsm functions to FormData. r=mikedeboer, r=smaug
MozReview-Commit-ID: Ej45wPeddtQ
2017-06-15 08:49:17 +07:00
Cameron McCormack 4cfbfe320e Bug 1372061 - Add node flag recording whether we might have anonymous children. r=bholley
MozReview-Commit-ID: CMaxJ1JnuYJ

--HG--
extra : rebase_source : ac5651b0d42125fd2a4ff3f5ce03f7a6c6ab1fbb
2017-06-27 23:56:12 -07: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
Boris Zbarsky 633b9f4d31 Bug 1373798 part 3. Rewrite our existing checks for the state of the "dir" attr on top of the new event state flags. r=mystor
MozReview-Commit-ID: LpCYABK5ZRN
2017-06-19 23:24:59 -04:00
Wes Kocher 84816f4647 Backed out 5 changesets (bug 1373798) for browser_parseable_css.js failures a=backout CLOSED TREE
Backed out changeset ef2e6aa3ae88 (bug 1373798)
Backed out changeset 0970ac62b245 (bug 1373798)
Backed out changeset dc19b4db7e51 (bug 1373798)
Backed out changeset a5dd7744170e (bug 1373798)
Backed out changeset 2c8752c4b6fb (bug 1373798)

MozReview-Commit-ID: J1WkPvRqELs
2017-06-19 15:56:47 -07:00
Boris Zbarsky 0abd585823 Bug 1373798 part 3. Rewrite our existing checks for the state of the "dir" attr on top of the new event state flags. r=mystor
MozReview-Commit-ID: LpCYABK5ZRN

--HG--
extra : rebase_source : 2771f8fb377b051b8dc8d93d08a2360817331f21
2017-06-19 14:42:01 -04:00
Dominic Farolino 6590a708e6 Bug 1368097 - Update standards link. r=smaug
--HG--
extra : rebase_source : d96b3043a1f55d8a61042046e0fe1fd47df8c4b5
2017-05-26 14:02:00 -04:00