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

29 Коммитов

Автор SHA1 Сообщение Дата
Timothy Guan-tin Chien 28b5c3416c Bug 1514040 - Dispatch events to hidden datetimebox UA Widget r=smaug
The XBL binding implementation relied on nsDateTimeControlFrame to call into
its nsIDateTimeInputArea implementation. This is correct because the XBL binding
is only constructed when the element has a frame. If the value is set while the
element is hidden, the XBL binding will pick up the correct value during construction.

That is not the case for UA Widget. As it is constructed when the DOM is attached,
relying on nsDateTimeControlFrame to send an event when attributes change means
the event won't be sent to the already constructed UA Widget.

This patch fixes that by moving the event dispatching calls originating from
HTMLInputElement out of nsDateTimeControlFrame, so they will behave correctly in
the absence of the frame.

I've also moved the gut of nsDateTimeControlFrame::HasBadInput() to
DateTimeInputTypeBase::HasBadInput(). Content script should be allowed to validate
the input without the frame.

Sadly this means the XBL implementation and the UA Widget implementation
have further diverged. The complexity should go away when we could finally
remove the XBL implementation.

nsDateTimeControlFrame still dispatches a few events to UA Widget, in
AttributeChanged() and SyncDisabledState(), as they are originated from the layout.

The name of the events in AttributeChanged() are incorrect though -- I am correcting
that in this patch too.

Differential Revision: https://phabricator.services.mozilla.com/D15601

--HG--
extra : moz-landing-system : lando
2019-01-04 21:53:51 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Timothy Guan-tin Chien 720f2da242 Bug 1496242 - Part II, Convert datetimebox to UA Widget r=dholbert,jaws,smaug
This patch converts datetimebox.xml to datetimebox.js and loads it as a UA Widget,
while touches things here and there to make it work.

In HTMLInputElement manages the lifecycle of the datetimebox UA Widget.
It is loaded when in <input> has type date or time, or have its type switch to date or time.

nsDateTimeControlFrame is changed so that when UA Widget is enabled,
it would not generate <xul:datetimebox>.

Like bug 1483972, a check is added in nsCSSFrameConstructor::CreateGeneratedContentItem()
to make sure we don't generate pseudo content inside <input>.

Assertions in IntlUtils is changed to allow UAWidget to call the methods.

Depends on D9056

Differential Revision: https://phabricator.services.mozilla.com/D9057

--HG--
rename : toolkit/content/widgets/datetimebox.xml => toolkit/content/widgets/datetimebox.js
extra : moz-landing-system : lando
2018-11-03 05:31:05 +00:00
Timothy Guan-tin Chien 3856b5e646 Bug 1496242 - Part I, Simplify nsIDateTimeInputArea interface r=mconley,smaug
This patch simplifies the nsIDateTimeInputArea interface, implemented by the
datetimebox bindings, to a point that is easier to convert it to dispatch events,
by doing the following:

- hasBadInput() is re-implemented in C++ in nsIDateTimeControlFrame since
  C++ needs the return value synchronously.
- SetValueFromPicker() and SetPickerState() are avoided completed since they
  are simply called by HTMLInputElement methods exposed to the frame
  script. They are avoided by having the frame script access the NAC and call
  the nsIDateTimeInputArea methods directly.
- Merge setEditAttribute() and removeEditAttribute() to updateEditAttributes()
  which takes no arguments, and have the method access the attribute values by
  reading the values from <input>.

This patch is a scaled-down version of the patch proposed in bug 1456833.
The event approach is only usable in UA Widget version of datetimebox because
there is no way to avoid leaking events to the document without Shadow DOM.

Differential Revision: https://phabricator.services.mozilla.com/D9056

--HG--
extra : moz-landing-system : lando
2018-11-02 23:29:42 +00:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Emilio Cobos Álvarez 74b31155f7 Bug 1423167: Move most attribute-related methods from nsIContent to Element. r=bz
MozReview-Commit-ID: 6WXqNiODttD
2017-12-06 16:05:59 +01:00
Mats Palmgren 25cd0c37f7 Bug 1400618 part 1 - Collect NAC / generated content and call DestroyAnonymousContent / UnbindFromTree on those after the frames are destroyed. r=bz
MozReview-Commit-ID: 2trDgeJPw25
2017-11-07 01:20:33 +01:00
Daniel Holbert 680815cd6e Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: EuRsDue63tK

--HG--
extra : rebase_source : 3356d4b80ff6213935192e87cdbc9103fec6084c
2017-10-27 10:33:53 -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
Jonathan Watt bcaeb4d9e8 Bug 1379474 - Update various ReflowInput variable names to match the new type name. r=xidorn
MozReview-Commit-ID: 1pMLInpeMGY
2017-07-25 12:02:35 +01:00
Carsten "Tomcat" Book 6121e5b902 Backed out changeset 31c43a9ffa8b (bug 1379474) for bustage 2017-07-10 08:06:30 +02:00
Jonathan Watt b4ab3914e7 Bug 1379474 - Update various ReflowInput variable names to match the new type name. r=xidorn
MozReview-Commit-ID: 1pMLInpeMGY
2017-06-13 11:45:17 +01:00
Jessica Jong d400a98b87 Bug 1374967 - Part 2: Consider step when deciding whether to show second/millisecond field. r=smaug
We should consider step and step base when deciding whether to show second and
millisecond field, since step and step base can affect the valid time intervals,
and the valid intervals may have second/millisecond part.

MozReview-Commit-ID: H4mJvLTvBOM
2017-06-29 11:47:00 -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
Carsten "Tomcat" Book 8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey 6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey 4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Jessica Jong fdb38c21da Bug 1372369 - Part 2: Set validity state to 'bad input' when the entered date value is invalid. r=smaug
If all fields in date/time input box are available but the input element's
value is empty, implies that it has been sanitized. In this case, we'll set the
'bad input' validity state. If any of the fields is cleared, we'll remove the
'bad input' validity state, as incomplete field does not imply 'bad input'.

MozReview-Commit-ID: 4EBpH5CWqXM
2017-06-19 01:13:00 -04:00
Alexis Beingessner adb013669b Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-13 11:00:10 -04:00
Sebastian Hengst f3bf820bfd Backed out changeset 3d1ce85e6348 (bug 1088760) for bustage, at least on Android at layout/generic/nsPluginFrame.cpp:1612. r=backout 2017-06-13 00:30:03 +02:00
Alexis Beingessner c75211cb95 Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-12 17:32:48 -04:00
Mats Palmgren ec6b1ef065 Bug 1364805 part 1 - Make every concrete frame class be a NS_DECL_QUERYFRAME_TARGET. r=jfkthame
MozReview-Commit-ID: Gy9gcEYupeY
2017-05-26 12:11:11 +02:00
Emilio Cobos Álvarez e44543aad4 Bug 1360241: Devirtualize nsIFrame::GetType. r=heycam
MozReview-Commit-ID: 5Nzhyta5Hle

--HG--
extra : rebase_source : c2e9d4bfb9239f5e851d110cd7dff98c1e1a8d8b
2017-04-30 17:30:08 +02:00
Mats Palmgren 6ef6efaea3 Bug 1340771 part 2 - Introduce a WeakFrame class for heap allocated weak frame pointers, stored in a hashtable for fast lookup. r=tn
* * *
Bug 1340771 part 3 - Change existing heap allocated AutoWeakFrame instances to use WeakFrame instead.  r=tn

MozReview-Commit-ID: GSuUiy98jBa
2017-03-01 18:03:14 +01:00
Mats Palmgren d13aaf9ce0 Bug 1340771 part 1 - Rename nsWeakFrame to AutoWeakFrame (automated change). r=tn
MozReview-Commit-ID: 8pl4nyeGEkr
2017-03-01 18:03:14 +01:00
Jessica Jong b3014cc00b Bug 1288591 - Implement the layout for <input type=time>. r=mconley, r=dholbert, r=smaug 2016-10-06 00:17:00 -04:00