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

204 Коммитов

Автор SHA1 Сообщение Дата
Andrea Marchesini b8bb98af8c Bug 1430997 - Rename nsINode::IndexOf to nsINode::ComputeIndexOf, r=catalinb 2018-01-23 14:30:18 +01:00
Boris Zbarsky f1d64479e7 Bug 1431964 part 10. Remove nsIDOMAttr. r=mccr8
MozReview-Commit-ID: xj4QeXBF9V
2018-01-21 12:07:31 -05:00
Andrea Marchesini 8768fe8991 Bug 1425440 - Replace RemoveChildAt_Deprecated with RemoveChildNode in nsGenericHTMLElement, r=catalinb 2018-01-16 14:17:11 +01:00
Andrea Marchesini 43c8e4e21b Bug 1425440 - Get rid of GetChildAt_Deprecated in nsRange, r=catalinb 2018-01-12 15:33:13 +01:00
Emilio Cobos Álvarez 63b7c47b72 Bug 1428339: Make attribute mapping work without a pres context. r=heycam
MozReview-Commit-ID: FisYWoArX0N

--HG--
extra : rebase_source : b47cd6960b9bb44fc4573b295068fec01339322a
2018-01-05 13:47:04 +01:00
Andrea Marchesini 6ee7f4e6f3 Bug 1425321 - Renaming nsINode::RemoveChildAt to RemoveChildAt_Deprecated, r=catalinb 2018-01-03 14:01:03 +01:00
Emilio Cobos Álvarez c8eb630ebe Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez ffdf5d2cb5 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00
Emilio Cobos Álvarez c0959b2955 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W

--HG--
extra : rebase_source : 09b82acb4f3d69e8a4345457ab217443bc28d6e2
2017-12-07 19:13:50 +01:00
Kris Maglione 1c66345e09 Bug 1415352: Part 1a - Pass subject principal through to ParseAttribute. r=bz
This is necessary in order to parse style attributes using the subject
principal of the caller, rather than defaulting to the page principal.

MozReview-Commit-ID: GIshajQ28la

--HG--
extra : rebase_source : 5dba46f61d70ec647cae16383b62961ac72d2f47
2017-11-01 20:35:52 -07:00
Nika Layzell 3409141758 Bug 1414974 - Part 2: Switch many consumers to nsGlobalWindow{Inner,Outer}, r=smaug
This is a large patch which tries to switch many of the external consumers of
nsGlobalWindow to instead use the new Inner or Outer variants.

MozReview-Commit-ID: 99648Lm46T5
2017-11-09 10:44:47 -05:00
Sebastian Hengst 898ad474fe Backed out changeset 4427e7f72c8e (bug 1414233) for crashing in mochitest dom/base/test/test_bug1375050.html. r=backout on a CLOSED TREE 2017-11-06 23:38:00 +02:00
Catalin Badea 6187f14497 Bug 1414233 - Remove nsINode::GetChildAt from nsRange::GetInnerTextNoFlush. r=masayuki 2017-11-03 04:35:00 -04: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
Hiroyuki Ikezoe a5c66d4d97 Bug 1407463 - Drop unused pseudo atom argument from ResolveStyleLazily and ResolveStyleLazilyInternal. r=heycam
MozReview-Commit-ID: Lmjqbr7QsTU

--HG--
extra : rebase_source : dc1587cd9058bf279f21116a843928289b2602f2
2017-10-11 10:00:28 +09: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
Cameron McCormack 6fdd311839 Bug 1404180 - Don't allow associating form elements by ID to <form>s across anonymous subtree boundaries. r=smaug
MozReview-Commit-ID: KRJjrkL4FgZ

--HG--
extra : amend_source : 80cd5e00804a8b2a5fd4e51b0f7ea9160dd63b1c
2017-10-02 13:10:18 +08: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 cb3d8d129c Bug 850684. Make sure offset* is computed correctly on absolutely positioned kids of relatively positioned elements with scrolllframes and borders. r=mats
The check for isAbsolutelyPositioned was an old incorrect attempt to fix bug
81290.  We have since added the proper fix (not adding offsets of the offset
parent frame) in bug 375003.

MozReview-Commit-ID: 7NgnfrYcs8h
2017-09-26 02:01:57 -04:00
Bobby Holley 2ceae78919 Bug 1401992 - Don't cross anonymous boundaries when finding the fieldset. r=bz
MozReview-Commit-ID: DiywRognpqx
2017-09-22 15:38:32 -07:00
Masatoshi Kimura 5f035965ac Bug 1390209 - Remove unused nsIDOMHTML*Element interfaces. r=qdot
MozReview-Commit-ID: DagD3IHhRZy

--HG--
extra : rebase_source : 2add5ad8e9181ba9bf29f53a6df75b730ab5ea78
2017-08-15 01:31:47 +09:00
Masayuki Nakano 8872065ef4 Bug 1388004 - part2: Make nsGenericHTMLElement::GetAssociatedEditor() return TextEditor instead of nsIEditor r=smaug
nsGenericHTMLElement::GetAssociatedEditor() retrieves TextEditor if the element is <input type="text"> or something, or <textarea>, or if it's editable, HTMLEditor associated to the document.  So, this method can return TextEditor (HTMLEditor is a subclass of TextEditor).

MozReview-Commit-ID: BvpFPaPLY70

--HG--
extra : rebase_source : 69edbe17aeb1ac72a8f8d247e5baca998569250e
2017-08-07 16:53:59 +09:00
Emilio Cobos Álvarez f4670943e9 Bug 1382568: followup: Fix comment wording. r=me
MozReview-Commit-ID: IHhceyG4oDz
2017-08-05 11:42:08 +02:00
Emilio Cobos Álvarez 9f99a8ad5f Bug 1382568: Avoid trying to resolve styles in an uninitialized presshell in GetInnerText. r=heycam
MozReview-Commit-ID: DFFb5OCQpHG

--HG--
extra : rebase_source : 2338719ce46efc405d845cc41ea633336c4e971c
2017-08-05 08:55:50 +02:00
Cameron McCormack 5a641131b9 Bug 1384824 - Part 1: Lazily clear stale Servo element data from a document when its pres shell changes. r=bholley
MozReview-Commit-ID: 1c566PRqFpe
2017-08-04 19:26:04 +10:00
Jessica Jong 47209070af Bug 1385478 - Part 2: Change Required/IsRequired() to look at NS_EVENT_STATE_REQUIRED instead. r=bz
In order to speed up Required/IsRequired(), instead of querying for the
@required attribute, we're now using the NS_EVENT_STATE_REQUIRED flag to know
whether an element's value is required.

For this to work correctly, we need to set NS_EVENT_STATE_REQUIRED earlier,
that is, in AfterSetAttr(), before any consumer of IsRequired(). We also need
to update or clear our required states when input type changes, since we may
have changed from a required input type to a non-required input type or
vice versa.

Note that NS_EVENT_STATE_REQUIRED/OPTIONAL is now part of the
EXTERNALLY_MANAGED_STATES.

MozReview-Commit-ID: Bjiby9GqJSB
2017-08-03 01:27:00 -04:00
Sebastian Hengst bbe32b6bed merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 44WBcWjnVo
2017-07-30 11:19:17 +02:00
Jessica Jong 231ed0b800 Bug 1376695 - Check HasName() before CanHaveName(). r=ehsan
We should check HasName() first because HasName() should be cheaper and would
typically be false.

MozReview-Commit-ID: 8l7WQR7Lcxj

--HG--
extra : amend_source : 2ea6f2bb230367c5f4d5ec0b02a2436372c937c2
2017-07-29 11:56:53 -04:00
Xidorn Quan 5e0dccf638 Bug 1382568 followup - Fix build bustage.
MozReview-Commit-ID: 4GLzEe9wWqz
2017-07-30 15:11:53 +10:00
Emilio Cobos Álvarez 7a703d0964 Bug 1382568: Use the flattened tree instead of the DOM tree in IsOrHasAncestorWithDisplayNone. r=heycam
MozReview-Commit-ID: 334fnSSHN7Z

--HG--
extra : rebase_source : a85166c270b8444866c2fd83a136512f53e6d9dc
2017-07-30 04:14:32 +02:00
Emilio Cobos Álvarez b928426a05 Bug 1382568: Use range-based for loop instead of array indexing in IsOrHasAncestorWithDisplayNone. r=heycam
MozReview-Commit-ID: H8Gbh523eoO

--HG--
extra : rebase_source : 554a01af9b44086456c55f5d37ef2662ac11c497
2017-07-30 04:13:48 +02:00
Emilio Cobos Álvarez cd2bc8f94c Bug 1382568: Use AutoTArray in IsOrHasAncestorWithDisplayNone. r=heycam
MozReview-Commit-ID: EiRJOPFWEiN

--HG--
extra : rebase_source : a3860c16b89ef67bf8e1b34d979ba97740c4ab01
2017-07-30 04:12:34 +02:00
Jessica Jong 490097db70 Bug 1376695 - Part 1: Let ElementHasName flag be applied to all nodes. r=ehsan
We'd like to use HasName() to know whether a node has a name attribute, but now
it's only applied to elements that CanHaveName(), hence we change it so that
it's applied to all nodes. Therefore, when document named items related
functions wants to use HasName() now, it must also check CanHaveName().

MozReview-Commit-ID: 2i5hfjnxXIF
2017-07-26 02:33:00 -04:00
Jessica Jong 3342b6100d Bug 1375599 - Change IsDisabled() to look at NS_EVENT_STATE_DISABLED instead of the "disabled" attribute. r=bz
In order to speed up IsDisabled(), instead of querying for the @disabled
attribute, we're now using the NS_EVENT_STATE_DISABLED flag to know whether an
element is disabled.
It is safe to use the NS_EVENT_STATE_DISABLED flag for the following reasons:
- For form elements, nsGenericHTMLFormElement::IsDisabled() is only called on
  form elements that can be disabled; form elements that can't be disabled
  overrides IsDisabled() to return false directly.
  And, before this patch, NS_EVENT_STATE_DISABLED flag is set by
  nsGenericHTMLFormElement::IntrinsicState() if and only if IsDisabled() in all
  cases when CanBeDisabled() is true, and when CanBeDisabled() is false then
  IsDisabled() is always false and the flag is not set.
- For non form elements, optgroup and option have the flag matching
  IsDisabled(). Note that option's IsDisabled() should also refer to optgroup's
  (if it exists) disabled state, which was not done before this patch.

For this to work correctly, we need to set NS_EVENT_STATE_DISABLED earlier,
that is, in AfterSetAttr(), before any consumer of IsDisabled().
We also need to update the flag whenever the element's parent (e.g. fieldset or
optgroup) disabled state changes and when moving into/out of a parent
container.

Note that NS_EVENT_STATE_DISABLED/ENABLED is now part of the
EXTERNALLY_MANAGED_STATES.

MozReview-Commit-ID: KSceikeqvvU
2017-07-20 02:15: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
Jessica Jong b52a4e5094 Bug 1366361 - Part 1: .action/formAction should return the document's URL if @action/formaction is missing or empty. r=smaug
MozReview-Commit-ID: H4CK0SVpaCv
2017-07-17 14:17:19 +08:00
Boris Zbarsky 05bf7c12c0 Bug 1380393 part 1. Remove some unused nsIDOMHTMLElement bits. r=mccr8 2017-07-13 23:45:49 -04: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
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Olli Pettay 21b0ca3bbf Bug 1378196, Make IsEventAttributeName non-virtual in common case, r=ehsan
--HG--
extra : rebase_source : 9daf46de13698348b7ab6b68f8da13ffb338c0a0
2017-07-04 23:54:30 +03:00
Ehsan Akhgari 71cf452a94 Bug 1377801 - Add a var cache for the browser.autofocus pref; r=mystor 2017-07-04 13:49:41 -04:00
Bill McCloskey f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -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
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 ce6f58ef1b Bug 1373744 - Change nsGenericHTMLElement::CopyInnerTo to call SetParsedAttr instead of SetInlineStyleDeclaration r=bz
Currently, nsGenericHTMLElement::CopyInnerTo uses SetInlineStyleDeclaration to clone CSS attributes. However, if we used SetParsedAttr instead, the declaration block would be addref'ed instead of being cloned.

We need to mark the declaration block as immutable in that situation so that the attribute is copied on write.

MozReview-Commit-ID: QMm23bfwqD

--HG--
extra : rebase_source : a7d8596e2f52bef21e56b9a979638c970be4c603
2017-06-16 14:43:45 -07:00