[webkit-dev] Proposal and ideas for a new .in format

Julien Chaffraix julien.chaffraix at gmail.com
Thu Jun 19 00:41:25 PDT 2008


On Wed, Jun 18, 2008 at 11:42 PM, Maciej Stachowiak <mjs at apple.com> wrote:
>
> On Jun 18, 2008, at 3:30 PM, Julien Chaffraix wrote:
>
>> Hi all,
>>
>> following several issues raised about the XML format, I have tried a
>> variation of the format Maciej proposed.
>>
>> Here is an exemple:
>>
>> # the first part contains the common parameters (may be empty)
>> namespace=html
>> cppNamespace=WebCore
>> namespaceURI=http://www.w3.org/1999/xhtml
>>
>> # an empty line separate the 2nd part from the tags
>> # the first one is the tag, followed by a comma separated list of
>> attributes / values.
>> a           upperCase=Anchor, noWrapperFactory=1
>> audio    applyAudioHack=1
>
> Could you show a few more examples?

Sure, here is what HTMLTagNames.in would look like (HTMLTagNames.in is
the file that has the most exceptions right now):

namespace=HTML
namespacePrefix=xhtml
cppNamespace=WebCore
namespaceURI=http://www.w3.org/1999/xhtml

a upperCase=Anchor, noWrapperFactory=1
abbr
acronym
address
applet
area
#if ENABLE_VIDEO
audio applyAudioHack=1
#endif
b noWrapperFactory=1
base
basefont upperCase=BaseFont
bdo
big
blockquote
body
br upperCase=BR
button
canvas
caption upperCase=TableCaption
center noWrapperFactory=1
cite noWrapperFactory=1
code noWrapperFactory=1
col upperCase=TableCol
colgroup
dd
del upperCase=Mod
dfn noWrapperFactory=1
dir upperCase=Directory
div
dl upperCase=DList
dt
em noWrapperFactory=1
embed
fieldset upperCase=FieldSet
font
form
frame
frameset upperCase=FrameSet
head
h1 upperCase=Heading
h2 customWrapper=h1
h3 customWrapper=h1
h4 customWrapper=h1
h5 customWrapper=h1
h6 customWrapper=h1
hr upperCase=HR
html
i noWrapperFactory=1
iframe upperCase=IFrame
image customWrapper=img
img upperCase=Image
input
ins customWrapper=del
isindex upperCase=IsIndex
kbd noWrapperFactory=1
keygen customWrapper=select
label
layer
legend
li upperCase=LI
link
listing customWrapper=pre
map
marquee
menu
meta
nobr noWrapperFactory=1
noembed noWrapperFactory=1
noframes noWrapperFactory=1
nolayer noWrapperFactory=1
noscript noWrapperFactory=1
object
ol upperCase=OList
optgroup upperCase=OptGroup
option
p upperCase=Paragraph
param
plaintext noWrapperFactory=1
pre
q upperCase=Quote
s noWrapperFactory=1
samp noWrapperFactory=1
script
select
small noWrapperFactory=1
#if ENABLE_VIDEO
source applyAudioHack=1
#endif
span noWrapperFactory=1
strike noWrapperFactory=1
strong noWrapperFactory=1
style
sub noWrapperFactory=1
sup noWrapperFactory=1
table
tbody upperCase=TableSection
td upperCase=TableCell
textarea upperCase=TextArea
tfoot customWrapper=tbody
th customWrapper=td
thead customWrapper=tbody
title
tr upperCase=TableRow
tt noWrapperFactory=1
u noWrapperFactory=1
ul upperCase=UList
var
#if ENABLE_VIDEO
video applyAudioHack=1
#endif
wbr noWrapperFactory=1
xmp

==============================================

> Also, what would the per-tag attributes
> be and what are the meaning?

It is the parameters whose values vary with the tags. In
make_names.pl, they are used to tweak code generation.

> I'm not sure what the audio hack is.

Audio tags need a special wrapper so the attribute triggers generating
it. Maybe "isAudioTag" would be more explicit?

> Instead of "upperCase", might it make sense to call that "interfaceName" for
> cases where the interface is not the obvious thing derived from the tag
> name? "Anchor" isn't really an uppercase version of "a", and for h1-h6 all
> of them would have Header in the interface name, but it's not really an
> uppercase version. Might it make sense to even say
> interface=HTMLAnchorElement?

upperCase usually really represents the upper case (Camel-case) name
but there is some exceptions.
I am fine with "interface" or "interfaceName" but you could not write
interface=HTMLAnchorElement as the "interface" value has other use
that just the class name (wrapper function name, QualifiedName, ...).
Maybe "useCustomInterface" would be an even better name as there is a
default value?

Regards,

Julien


More information about the webkit-dev mailing list