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

196 Коммитов

Автор SHA1 Сообщение Дата
Nicholas Nethercote 8ad99dd7fa Bug 1411893 - Introduce nsStaticAtom. r=emilio,froydnj.
It's a sub-class of nsAtom, useful for cases where you know you are dealing
exclusively with static atoms. The nice thing about it is that you can use
raw nsStaticAtom pointers instead of RefPtr<>. (In fact, the AddRef/Release
implementations ensure that we'll crash if we use RefPtr<nsStaticAtom>.)

MozReview-Commit-ID: 4Q6QHX5h44V

--HG--
extra : rebase_source : e4237f85b4821b684db0ef84d1f9c5e17cdee428
2017-10-27 10:31:13 +11:00
Kris Maglione 4275cd1039 Bug 1406278: Part 1 - Pass subject principal to SetAttribute and friends. r=bz
In order to tailor certain security checks to the caller that is attempting to
load a particular piece of content, we need to be able to attach an
appropriate triggering principal to the corresponding requests. Since most
HTML content is loaded based on attribute values, that means capturing the
subject principal of the caller who sets those attributes, which means making
it available to AfterSetAttr hooks.

MozReview-Commit-ID: BMDL2Uepg0X

--HG--
extra : rebase_source : 25e438c243700a9368c393e40e3a6002d968d6c8
2017-10-09 14:33:38 -07: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
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
Stone Shih dcc75d78ac Bug 1399740 - [Pointer Event] Handle the case that invokes setPointerCapture while the page has a locked element. r=smaug.
Spec says we should throw an exception when setting pointer capture while the page has a locked element. Also, we should release all pointer capture when a pointer lock is successfully applied on an element.

MozReview-Commit-ID: CuUIPipJWB0
2017-09-14 14:29:04 +08:00
Sebastian Hengst 5a95ac34b4 merge mozilla-central to autoland. r=merge a=merge 2017-09-29 11:49:46 +02:00
Thomas Wisniewski cdaa875696 Bug 1389274 - Correct the behavior of Element.scrollIntoView to match the draft spec and pass web platform tests; r=annevk,bkelly
MozReview-Commit-ID: 3is36wstsdb

--HG--
extra : rebase_source : f4a7598aad5b04a2dcaf40d09ee7733b4d6982f6
2017-09-28 16:57:24 -04:00
Sebastian Hengst 8b3a2fc88e Backed out changeset 8a970e561fe1 (bug 1389274) for unexpected passes of web-platform-test /cssom-view/scrollIntoView-shadow.html. r=backout 2017-09-28 19:46:03 +02:00
Thomas Wisniewski 86f49170db Bug 1389274 - Correct the behavior of Element.scrollIntoView to match the draft spec and pass web platform tests; r=annevk,bkelly
MozReview-Commit-ID: 3is36wstsdb

--HG--
extra : rebase_source : f063ca918d30998dc03c0c73206db495257758a2
2017-09-27 12:23:33 -04:00
Stone Shih a1d26ab3b4 Bug 1316251 Part1: Separate pointer event implementation from PresShell. r=masayuki
This patch moves pointer event related implementations to a new class.

MozReview-Commit-ID: FdBYl7vYC5I
2017-09-06 15:47:49 +08:00
Wes Kocher 47b3660c80 Merge m-c to inbound, a=merge
MozReview-Commit-ID: 8wTTCUkrY2i
2017-09-25 16:43:51 -07: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
Xidorn Quan e040c67e4d Bug 1401792 - Release assert when adopting element with style data across style backend. r=bholley
MozReview-Commit-ID: 6D6bvSJHEcS

--HG--
extra : source : 04d359e0ef0552ab61987427147265c229d80069
2017-09-21 14:41:21 +10:00
Emilio Cobos Álvarez 3bbd915f86 Bug 1394935: Add a special case for marking something as dirty from invalidation code. r=bholley
Not sure about the name, or whether making it a static or not (a static seemed
slightly clearer, but nbd, feel free to bikeshed about it).

MozReview-Commit-ID: FHGmcoprN2Q

--HG--
extra : rebase_source : 2f68a55ee861d9eacc56004cb98470a518574626
2017-08-31 09:42:26 +02:00
Bobby Holley 7210bd7226 Bug 1383332 - Track the restyle root and use it to do less work during the traversal. r=emilio
MozReview-Commit-ID: A8O3JOpsv4E
2017-08-22 21:19:24 -07:00
Henri Sivonen 2607c163b1 Bug 1375701 - Atomize class attribute value in the parser in the innerHTML case. r=Ehsan
MozReview-Commit-ID: CKyGlzYS15e

--HG--
extra : rebase_source : 9ece88d9c85d98665413a7f9d730d7ff149d8486
2017-08-11 09:22:57 +03:00
Sebastian Hengst 14cf46a41a Backed out changeset fabf345eec6e (bug 1375701) for bustage at parser/html/nsHtml5String.h:143:3: bad implicit conversion constructor for 'nsHtml5String'. r=backout on a CLOSED TREE 2017-08-15 16:28:10 +02:00
Henri Sivonen 6815b2d2c7 Bug 1375701 - Atomize class attribute value in the parser in the innerHTML case. r=Ehsan
MozReview-Commit-ID: CKyGlzYS15e

--HG--
extra : rebase_source : a66d3d1659aec509c50f3ca641c0eb1d87151104
2017-08-11 09:22:57 +03:00
Milan Sreckovic 8ad3e52a49 Bug 1387514: Upgrade BaseRect (derived classes) width and height direct member variable use to instead use Width()/SetWidth() and Height()/SetHeight() in dom/*. r=overholt
MozReview-Commit-ID: B9YWmM3C1oX

--HG--
extra : rebase_source : d7c27de968295ee13ece8bda23798cb215d60a4b
2017-08-14 08:30:10 -04: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 1cf62db957 Bug 1389681 - Move NoteDirty* to Element. r=emilio
MozReview-Commit-ID: KvKAEuYkssx
2017-08-12 10:12:28 -07: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
Bobby Holley ff0b8d0ebf Bug 1389385 - Generalize C++ NoteDirtyDescendants logic and add equivalent APIs for the animation bit. r=emilio
MozReview-Commit-ID: 8K0uDibfoZS
2017-08-11 18:17:49 -07:00
Bobby Holley c52ef0e259 Bug 1389385 - Move NoteDirtyDescendantsForServo out of line. r=emilio
This function is large enough that it doesn't really make sense to have inline,
and we'll be adding more to it in the coming patches.

MozReview-Commit-ID: AnDfzwsMvNy
2017-08-11 18:17:49 -07: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
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
Wei-Cheng Pan 619e849e4c Bug 1363805 - Part 2: Add a flag to note that a child has LaterSiblings hint. r=heycam
This flag is only used by nsComputedDOMStyle.

MozReview-Commit-ID: 2EzIYXCt5Rj

--HG--
extra : rebase_source : 2a61c6bd8b6005a24c641e31a77951bcd1dff56f
2017-09-13 16:47:03 +08:00
Kartikaya Gupta f0f7c1b640 Bug 1380375 - Remove the DOM bindings for the unused scrollgrab feature. r=smaug
MozReview-Commit-ID: 87aJOsc6zbO
2017-07-12 15:28:50 -04: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
cku 67b6f80c35 Bug 265894 - Part 1. Implement NS_IMPL_ELEMENT_CLONE_WITH_INIT_AND_PARSER. r=heycam
Implement this new macro to reuse clone code in SVGSymbolElement in the
following patch.

MozReview-Commit-ID: 4vobWVrcbn2

--HG--
extra : rebase_source : 11e7dd9fd11199689ed5dc2a532c6517cf2e21fe
2017-06-14 19:57:40 +08:00
Hiroyuki Ikezoe ade75cf304 Bug 1356141 - Don't traverse any elements that needed only for animation-only restyles in normal traversal. r=heycam
Before this patch, we were setting the dirty descendants bit in animation-only
restyles and it triggered unnecessary traversal for elements that does not need
the traversal (i.e no need selector matching).

MozReview-Commit-ID: 6pmF3ojVzgb

--HG--
extra : rebase_source : 5d83b203d4f5121c648be903165a0e9c77ca4a0c
2017-06-20 06:30:48 +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
Boris Zbarsky 8afc692082 Bug 1373798 part 2. Introduce event state flags that track the state of an element's "dir" attribute. r=mystor
MozReview-Commit-ID: EDCV2fUWGmX
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
Boris Zbarsky 54df8acf71 Bug 1373798 part 2. Introduce event state flags that track the state of an element's "dir" attribute. r=mystor
MozReview-Commit-ID: EDCV2fUWGmX

--HG--
extra : rebase_source : b2e588d6aab951eeb46b5b1e9321c82c83e0afa4
2017-06-19 14:41:58 -04:00
Kirk Steuber 0312c4f54a Bug 1370705 - Move attribute change effects from HTMLImageElement::BeforeMaybeChangeAttr to HTMLImageElement::AfterMaybeChangeAttr r=bz
It logically makes more sense for these effects to happen after the attribute has actually been changed and moving them allows us to get rid of the member variable HTMLImageElement::mForceReload.

MozReview-Commit-ID: IJBF3AHVb0U

--HG--
extra : rebase_source : fe3ae2a0cc55ded9702fb7654261ffee83a52057
2017-06-09 09:46:54 -07:00
Kirk Steuber 2feb07c8c6 Bug 1365092 - Moves side effects of HTMLImageElement's SetAttr function to the corresponding BeforeSetAttr and AfterSetAttr functions r=bz
This is necessary to facilitate the transition to cloning attributes instead of reparsing them.

HTMLImageElement's side effects proved to be a bit trickier than those of many other classes because HTMLImageElement::SetAttr intentionally forces an image reload, even if the attribute value has not been changed. Element::SetAttr, on the other hand, usually ignores attribute changes that do not change the attribute value, exiting before BeforeSetAttr is even called. In order to preserve this behavior, another virtual function |OnAttrSetButNotChanged| was added to the Element class. This function will be called in the case that Element::SetAttr exits early, allowing a forced reload to take place at that time.

MozReview-Commit-ID: 4CrH30bo5GT

--HG--
extra : rebase_source : 94245dde2710abd439671d05e99f145caca3e189
2017-06-01 15:38:45 -07:00
Kirk Steuber a02a78b5c7 Bug 1365092 - Moves side effects of nsGenericHTMLElement and Element's SetAttr, UnsetAttr, and ParseAttribute functions to the corresponding BeforeSetAttr and AfterSetAttr functions r=bz
This is necessary to facilitate the transition to cloning attributes instead of reparsing them.

MozReview-Commit-ID: HzB3f1sr9y9

--HG--
extra : rebase_source : 8c343c60b5dca18fb04a4cb548907a2e4b9df1d2
2017-05-31 11:01:47 -07:00
Brad Werth b4e5c552de Bug 1355675 Part 3: Add some Chrome-only getTransformTo... methods to Element. r=mattwoodrow,smaug
MozReview-Commit-ID: 5H2DXKJzE8H

--HG--
extra : rebase_source : a5089158676586e94ac1c8528dd052d52973c869
2017-05-30 09:42:25 -07:00
Boris Zbarsky 42c1cf9ea3 Bug 1364360 part 2. Make Element::GetScrollFrame take a flush type, not a "should I flush?" boolean. r=ehsan 2017-05-25 13:39:44 -04:00
Emilio Cobos Álvarez 47dc11465b Bug 1366474: While we're here, devirtualize GetSMILOverrideStyle too. r=birtles
Also, update an outdated comment that was leftover.

MozReview-Commit-ID: CC865rj3o3S

--HG--
extra : rebase_source : 094ed5c23a55f8f00f7aeb18856c539caa80ff86
2017-05-20 13:02:43 +02:00
Emilio Cobos Álvarez 9d58320b21 Bug 1366474: Devirtualize Element::{Get,Set}SMILOverrideStyleDeclaration. r=birtles
MozReview-Commit-ID: JYLt6lE0bZt

--HG--
extra : rebase_source : 4c57e9d274db1319504ac3072031b16da98d9e7c
2017-05-20 12:59:33 +02:00
Kirk Steuber e74f1cd513 Bug 1363481 - Add the old attribute value as a parameter to Element::AfterSetAttr r=bz
In order to facilitate the movement of code with side-effects called by Element::SetAttr to Element::BeforeSetAttr and Element::AfterSetAttr, Element::AfterSetAttr should have access to the old value of the attribute. This includes information about whether there was previously a value set or not.

Accomplishing this involved passing an additional argument through functions that find and change the old attribute value in order to ensure that we can differentiate between an empty old value and an absent old value (attribute was not set).

Note that while I tried to ensure that accurate values (and their absence) are reported to Element::AfterSetAttr, I largely ignored SVG. While the old value reported for SVG values should be however accurate the value already being reported to SetAttrAndNotify was, SVG elements do not currently report unset values properly because they will never pass a null pointer to SetAttrAndNotify.

MozReview-Commit-ID: K1mha8CNFZP

--HG--
extra : rebase_source : 42776eb01451d371e4aebcc17fe3dd112c8d268b
2017-05-18 14:09:01 -07:00
Bobby Holley de6dd624ed Bug 1363375 - Pack nsINode better on 64-bit and stop conditionally compiling mServoData. r=smaug 2017-05-11 13:51:28 +02:00
Emilio Cobos Álvarez 1da66ba5c4 Bug 1355343: Move node restyle bits to Element, and add bits for snapshot handling. r=bholley
MozReview-Commit-ID: 6OrUKX5RcBq
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

--HG--
extra : rebase_source : 83b38b7d67ce739160d3bb0efc89ed6f8f43092d
2017-04-16 08:16:24 +02:00
Emilio Cobos Álvarez 64ce8ef7f0 Bug 1361078: Remove unnecessary fast path in Element::GetPseudoElementType. r=dbaron
A more general fast path was added in bug 1355353.

MozReview-Commit-ID: HGe9WaojoYw

--HG--
extra : rebase_source : b8d99223422a95fd764ff47042df6fe68334bb89
2017-05-01 18:12:06 +02: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