Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(673)

Issue 175693007: Generate isHTML*Element() / toHTML*Element() helper functions (Closed)

Created:
6 years, 10 months ago by Inactive
Modified:
6 years, 10 months ago
CC:
blink-reviews, kenneth.christiansen, nessy, gavinp+prerender_chromium.org, gasubic, sof, eae+blinkwatch, fs, eric.carlson_apple.com, feature-media-reviews_chromium.org, dglazkov+blink, adamk+blink_chromium.org, vcarbune.chromium, philipj_slow, rwlbuis
Visibility:
Public.

Description

Generate isHTML*Element() / toHTML*Element() helper functions Generate isHTML*Element() / toHTML*Element() helper functions using html/HTMLTagNames.in as input. This avoids having to use macros to generate these for each HTMLElement type. This is also safer because the generated methods check the ContextFeatures and the RuntimeEnabledFeatures if needed. The generated helpers are located in an HTMLElementTypeHelpers.h header that is included in HTMLElement.h for convenience. I am planning to use this header later on to make ElementTraversal more powerful by letting the caller tell which type of Element (e.g. HTMLTableRowElement) it wants to iterate on. It would look like: ElementTraversal<HTMLTableRowElement>::next(). This is based on the following WebKit revision by <akling@apple.com>;: http://trac.webkit.org/changeset/154965 R= BUG=346095 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=167790

Patch Set 1 #

Patch Set 2 : Reupload #

Patch Set 3 : Fix typo #

Total comments: 2

Patch Set 4 : Make toHTMLObjectElement() work for FormAssociatedElement input #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+189 lines, -107 lines) Patch
A Source/build/scripts/make_element_type_helpers.py View 1 chunk +84 lines, -0 lines 0 comments Download
M Source/build/scripts/scripts.gypi View 1 chunk +5 lines, -0 lines 0 comments Download
A Source/build/scripts/templates/ElementTypeHelpers.h.tmpl View 1 2 1 chunk +64 lines, -0 lines 0 comments Download
M Source/core/core_generated.gyp View 1 chunk +17 lines, -0 lines 0 comments Download
M Source/core/dom/Element.h View 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/html/HTMLAnchorElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLAreaElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLBodyElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLCanvasElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLDataListElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLDetailsElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLDialogElement.h View 1 chunk +0 lines, -8 lines 0 comments Download
M Source/core/html/HTMLDivElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLElement.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/HTMLEmbedElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLFieldSetElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLFormElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLFrameElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLFrameSetElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLHeadElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLHtmlElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLIFrameElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLImageElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLInputElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLLabelElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLLegendElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLLinkElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLMapElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLMarqueeElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLMetaElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLMeterElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLOListElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLObjectElement.h View 1 2 3 2 chunks +7 lines, -3 lines 1 comment Download
M Source/core/html/HTMLOptGroupElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLOptionElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLParamElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLProgressElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLScriptElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLSelectElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLSourceElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLStyleElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLSummaryElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLTableCaptionElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLTableElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLTableRowElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLTableRowsCollection.cpp View 6 chunks +8 lines, -8 lines 0 comments Download
M Source/core/html/HTMLTemplateElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLTextAreaElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLTitleElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLTrackElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLVideoElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/shadow/HTMLContentElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/shadow/HTMLShadowElement.h View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
Inactive
I have only ported one file to the new isHTML*Element() helpers. I am planning on ...
6 years, 10 months ago (2014-02-22 02:04:30 UTC) #1
esprehn
On 2014/02/22 02:04:30, Chris Dumez wrote: > I have only ported one file to the ...
6 years, 10 months ago (2014-02-22 02:46:36 UTC) #2
Inactive
On 2014/02/22 02:46:36, esprehn wrote: > On 2014/02/22 02:04:30, Chris Dumez wrote: > > I ...
6 years, 10 months ago (2014-02-22 02:58:44 UTC) #3
Inactive
On 2014/02/22 02:46:36, esprehn wrote: > On 2014/02/22 02:04:30, Chris Dumez wrote: > > I ...
6 years, 10 months ago (2014-02-22 03:07:19 UTC) #4
esprehn
lgtm, the HTMLObjectElement thing is kind of weird though. https://codereview.chromium.org/175693007/diff/80001/Source/core/html/HTMLObjectElement.h File Source/core/html/HTMLObjectElement.h (right): https://codereview.chromium.org/175693007/diff/80001/Source/core/html/HTMLObjectElement.h#newcode117 Source/core/html/HTMLObjectElement.h:117: ...
6 years, 10 months ago (2014-02-22 03:19:12 UTC) #5
Inactive
https://codereview.chromium.org/175693007/diff/80001/Source/core/html/HTMLObjectElement.h File Source/core/html/HTMLObjectElement.h (right): https://codereview.chromium.org/175693007/diff/80001/Source/core/html/HTMLObjectElement.h#newcode117 Source/core/html/HTMLObjectElement.h:117: inline const HTMLObjectElement* HTMLObjectElement::fromFormAssociatedElement(const FormAssociatedElement* element) On 2014/02/22 03:19:13, ...
6 years, 10 months ago (2014-02-22 03:37:45 UTC) #6
Inactive
https://codereview.chromium.org/175693007/diff/200001/Source/core/html/HTMLObjectElement.h File Source/core/html/HTMLObjectElement.h (right): https://codereview.chromium.org/175693007/diff/200001/Source/core/html/HTMLObjectElement.h#newcode116 Source/core/html/HTMLObjectElement.h:116: template<typename T> inline const T& toElement(const FormAssociatedElement&); I made ...
6 years, 10 months ago (2014-02-23 18:27:32 UTC) #7
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 10 months ago (2014-02-24 23:24:09 UTC) #8
Inactive
The CQ bit was unchecked by ch.dumez@samsung.com
6 years, 10 months ago (2014-02-24 23:24:17 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/175693007/200001
6 years, 10 months ago (2014-02-24 23:24:20 UTC) #10
Inactive
Unless there is additional feedback, I am planning to land this tomorrow as my next ...
6 years, 10 months ago (2014-02-25 00:36:55 UTC) #11
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 10 months ago (2014-02-25 12:37:30 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/175693007/200001
6 years, 10 months ago (2014-02-25 12:37:55 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/175693007/200001
6 years, 10 months ago (2014-02-25 13:32:01 UTC) #14
commit-bot: I haz the power
6 years, 10 months ago (2014-02-25 15:33:31 UTC) #15
Message was sent while issue was closed.
Change committed as 167790

Powered by Google App Engine
This is Rietveld 408576698