473,606 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Arbitrary definition of class names by user agents

Stefan Ram wrote (in "More than one language in a page"):
In this case, one might even use Google's new attribute value:

<p lang="en">The word
<q><span lang="fr" class="notransl ate">chef</span></q>
is of French origin.</p>

See

http://googlewebmastercentral.blogsp...ge-barrier.htm
Is this a new trend of user-agent writers (Microformats, and now Google)
staking claims on the @class namespace? I'm surely not the only one
disturbed by this. Somehow, an author publishing on the web, with no
control over which user agents will access his page, has to avoid
clashes with the union of all names deemed special by all those user
agents, now and in the future?

I suppose the proponents justify this practice by a line in the HTML
spec (HTML4.01 §7.5.2), that class names are also for "general purpose
processing by user agents" as well as stylesheet selectors. It doesn't
go into any further detail, but I don't think it was the intention that
applications which the author has no control over (e.g. once a page is
published) should define class names willy-nilly. More likely, the
author would have opted in to some scheme, such as a company's internal
robot to do some advanced indexing on all its own pages.

Here are some ideas for external interpretation, i.e. by some 'third
party' such as Google:

* Opt in to a third party's scheme. Register ones URIs with Google,
so they know that 'notranslate' means what they think on those
pages. I don't fancy doing that with a lot of third parties, though.
* Third parties register class names with an authority (e.g. W3C).
But still, authors have to watch out for future uses of names.
And third parties shouldn't have to register with W3C when they've
already registered (for example) DNS names.
* Define a sub-namespace not used by CSS to form DNS-like names,
e.g. ':com:google:no translate'. Okay, but potentially verbose if
used a lot. And it doesn't generally sidestep non-CSS mechanisms
of defining class names.
* Use head/@profile with a URI owned by the third party. This is
what Microformats seem to be doing, but I don't think it is
adequate. Independent microformats used in the same page still
have to avoid clashing with each other, which means going back to
some authority's third-party register. Plus, the author doesn't
have control over the class names - it's all or nothing for a
particular format.
* Extend CSS with properties not related to style. There's nothing
in the framework of CSS that limits it to just style (right?). I
favour this, and shall elaborate on it...

Google could define a CSS property which turns translation on or off,
and the author could associate any class he chooses (indeed, any CSS
selector) with that property:

.notranslate { // Okay, so he chose the same one after all! ;-)
-google-translation: disable;
}

Then, to avoid Google having to scan his stylesheets just to find this
rule, the author links it in with:

<link rel="stylesheet " media="translat or" href="...">

Other user agents won't touch it, because they don't recognise
"translator ". Google won't touch other stylesheets because they're not
labelled with "translator ".

A few issues raised by this approach are:

* It's not style/presentation, which is what CSS was designed for.
But I think this is a superficial problem - just regard the name
"CSS" and rel="stylesheet " as historical accidents, and CSS
becomes an application of arbitrary properties, that happens to
include ones related to style.
* It's now invading the CSS-property and media-type namespaces. But
both of these could go the same way as XML namespaces and
link/@rel schemas, if necessary.

To summarise: Rather than user agents stomping over the heretofore
author-defined namespace of class names, they should fit into it in the
same way that CSS properties do. This would scale better, and would be
less intrusive on the author's ability to choose.
Oct 26 '08 #1
4 3007
Steven Simpson wrote:
Is this a new trend of user-agent writers (Microformats, and now
Google) staking claims on the @class namespace?
It surely is, and all the warnings seem to get ignored. The idea of
assigning fixed meanings to class names sounds _so_ cool and useful, and you
don't need anybody's permission or time-wasting discussions!

And it probably looks obvious that "notranslat e" won't accidentally be used
for something else by someone else, so it looks safe to define it as you
like. It might be different with shorter and more vague class names like
"date" - does it refer to date notations, or dating, or something else? You
cannot possibly know what the string "date" might intuitively mean to
billions of people speaking hundreds of different languages. So by
declaring, say, "date" as predefined, you would assign arbitrary meanings to
an unknown number of constructs in documents, meanings that need not have
anything to do with the intentions of their authors.

In fact, "notranslat e" is potentially very risky too. It is true that in any
existing document, it probably relates to someone's intentions of not having
something translated. But it might also mean that something _has not_ been
translated. Or it might mean 'do not translate (the content)' in a very
specific and limited technical meaning, _not_ a universal declaration that
the content should not be translated. For example, in some bilingual site
maintenance approach, it might be an instruction to human translators to
leave the content untranslated, since it shall be the same in both
languages - without meaning that it should be the same in _all_ languages.

The only sensible approach in using class attributes for purposes like
"notranslat e" in the Google technique would have been to use a class name
that is syntactically malformed by existing specifications. That way, no
legitimate existing usage of the string as class attribute would have been
affected.

Even better, a new attribute (or element) should have been introduced.

Someone might say that from the viewpoint of generalized markup, a
processing instruction might have been the most adequate approach. But
generalized markup is water under the bridge, and we live with tag sets that
everyone can use as he likes and sees fit.

And on the realistic side, translation instructions should not really be
merged into markup. They are process-oriented, not data-oriented or
structure-oriented. You typically have words or phrases that should not be
translated, and would you really like to be forced to add
non-translatability markup into each and every occurrence in each document,
instead of having e.g. a site-wide glossary of terms that specifies them,
among other things?

Besides, the most common case for non-translatability that I can imagine
right now is English words and phrases in non-English text. For them, common
sense might say that it should suffice to declare their language as English.
When translating, say, some text from Dutch to French, you are normally not
supposed to translate any English words and phrases in them. If they are OK
in the original, they're usually the right choice in the translation as
well. So the only thing needed would be language markup.
Google could define a CSS property which turns translation on or off,
That would be even more wrong than using "predefined " class names, since
translation issues are not presentational in the sense that CSS is supposed
to be.
* It's not style/presentation, which is what CSS was designed for.
But I think this is a superficial problem - just regard the name
"CSS" and rel="stylesheet " as historical accidents, and CSS
becomes an application of arbitrary properties, that happens to
include ones related to style.
Excuse me while fall into despair.
To summarise: Rather than user agents stomping over the heretofore
author-defined namespace of class names, they should fit into it in
the same way that CSS properties do.
I cannot recognize parody any more, sorry.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Oct 26 '08 #2
"Jukka K. Korpela" <jk******@cs.tu t.fiwrites:
Steven Simpson wrote:
>Is this a new trend of user-agent writers (Microformats, and now
Google) staking claims on the @class namespace?
<snip>
In fact, "notranslat e" is potentially very risky too. It is true that
in any existing document, it probably relates to someone's intentions
of not having something translated. But it might also mean that
something _has not_ been translated. Or it might mean 'do not
translate (the content)' in a very specific and limited technical
meaning, _not_ a universal declaration that the content should not be
translated. For example, in some bilingual site maintenance approach,
it might be an instruction to human translators to leave the content
untranslated, since it shall be the same in both languages - without
meaning that it should be the same in _all_ languages.
Agreed. It could also relate to the other meaning of "translate" --
the geometric one. A paragraph which is to be left in its normal
position, not translated in any direction, might well be marked
"notranslat e".

--
Ben.
Oct 26 '08 #3
Jukka K. Korpela wrote:
Steven Simpson wrote:
>Google could define a CSS property which turns translation on or off,

That would be even more wrong than using "predefined " class names,
since translation issues are not presentational in the sense that CSS
is supposed to be.
> * It's not style/presentation, which is what CSS was designed for.
But I think this is a superficial problem - just regard the name
"CSS" and rel="stylesheet " as historical accidents, and CSS
becomes an application of arbitrary properties, that happens to
include ones related to style.

Excuse me while fall into despair.
What's wrong? I'm not suggesting that we abandon the distinction
between content and presentation, merely recognising that only two
things constrain CSS technically to presentation:

* the set of properties defined by various specs,
* the media type/query filter,

....and by extending these together, you get a framework still capable of
separating presentation from content, but also capable of separating
other kinds of (erm) "interpretation " from content.

Looking at it another way, if you wanted to devise a framework for the
latter separation, you could easily come up with one identical to that
used for the former, except that:

* the file format's property set would differ from CSS's,
* you'd have a different set of @media,
* you wouldn't call the format CSS,
* your @rel type wouldn't mention 'style'.

It would be technically sufficient to continue using @rel="styleshee t",
and rely on @media to distinguish between presentation and 'other kinds
of interpretation' . But if that really is a problem, just use
@rel="propertys heet".
Oct 26 '08 #4
Jukka K. Korpela wrote:
Steven Simpson wrote:
>Is this a new trend of user-agent writers (Microformats, and now
Google) staking claims on the @class namespace?

It surely is, and all the warnings seem to get ignored. The idea of
assigning fixed meanings to class names sounds _so_ cool and useful, and
you don't need anybody's permission or time-wasting discussions!

And it probably looks obvious that "notranslat e" won't accidentally be
used for something else by someone else, so it looks safe to define it
as you like. It might be different with shorter and more vague class
names like "date" - does it refer to date notations, or dating, or
something else? You cannot possibly know what the string "date" might
intuitively mean to billions of people speaking hundreds of different
languages. So by declaring, say, "date" as predefined, you would assign
arbitrary meanings to an unknown number of constructs in documents,
meanings that need not have anything to do with the intentions of their
authors.

In fact, "notranslat e" is potentially very risky too. It is true that in
any existing document, it probably relates to someone's intentions of
not having something translated. But it might also mean that something
_has not_ been translated. Or it might mean 'do not translate (the
content)' in a very specific and limited technical meaning, _not_ a
universal declaration that the content should not be translated. For
example, in some bilingual site maintenance approach, it might be an
instruction to human translators to leave the content untranslated,
since it shall be the same in both languages - without meaning that it
should be the same in _all_ languages.

The only sensible approach in using class attributes for purposes like
"notranslat e" in the Google technique would have been to use a class
name that is syntactically malformed by existing specifications. That
way, no legitimate existing usage of the string as class attribute would
have been affected.
If Google had specified class="google:n otranslate" in place of
class="notransl ate", despite the lack of any intrinsic significance of
the x: in class names it would have gone a long way toward eliminating
potential conflict.
Oct 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
3381
by: Will Hartung | last post by:
Can someone clarify that multiple classes in the "class" attribute are ok and "legal" and not some fluke? So, I can do: ..pink {color: pink} ..bold {font-weight: bold} ..medium {font-size: 12pt} <p class="bold pink medium">bold pink medium sized text</p>
3
1401
by: Tony Johansson | last post by:
Hello! I have these two statements typedef const char *enum_txt; and enum_txt phase_tab ={"IDLE","LAUNCHING","LAUNCHED","ROLLING","BOOSTERRELEASE","SPACE"}; where in the class definition should these be put.
8
52749
by: Steven Livingstone | last post by:
Anyone able to explain to me why you cannot define an interface that can then be implemented using static methods? I understand the C# CLS states this, but just interested in the reasons behind it. thanks, Steven
5
1445
by: Steven D'Aprano | last post by:
I have a problem and I don't know where to start looking for a solution. I have a class that needs to call an arbitrary function and wait for a result. The function, being completely arbitrary and not under my control, may be very time consuming and possibly may not even halt. My class needs to be able to give up waiting for a result after a specified amount of time. I'm thinking something conceptually like this:
0
1626
by: Stefano | last post by:
Hi all, I'm trying to create a browser definition file (.browser) that matches crawlers user agents. I don't want modify browser files in the Config system folder. I'd like to use App_Browsers directory, instead. I don't want to use Request.Browser.Crawler, because I'd like to be able to use device filtering for crawlers. So, for example, I would create a browser named "crawler", so I can use
5
1677
by: raylopez99 | last post by:
I have a form, Form6, that has a bunch of buttons overlaid on it. I want to be able to click on any arbitrary area of the form, and if that area of the form is overlaid by a button, I want to change the color of the button to Coral, and show a MessageBox with the button name. So far, I've tried the below event handlers, and the only one that has worked is of course the named button event click, for a particular named button (button3...
2
1884
by: Rob Clewley | last post by:
Dear Pythonistas, How many times have we seen posts recently along the lines of "why is it that 0.1 appears as 0.10000000000000001 in python?" that lead to posters being sent to the definition of the IEEE 754 standard and the decimal.py module? I am teaching an introductory numerical analysis class this fall, and I realized that the best way to teach this stuff is to be able to play with the representations directly, in particular to be...
275
12180
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
82
10003
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a) html b) perl script (print and inserting into database) Cheers... Andrew
0
7942
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8429
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8084
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8300
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6761
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5461
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2443
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.