Namespace prefixes for media queries

Hi!

I'm involved in a project to write a Firefox extension that reads and
presents site navigation data (a sitemap) in a sidebar.  When a sitemap
is being presented, we'd like to enable the site author to change the
styles of his site, e.g. by applying { display: none } to (now
redundant) in-page navigation.

So far, we've done this by allowing a stylesheet to be specified in the
sitemap data, and then injecting it into the page.  Initially, we
inserted a <link> into the page, but this tended to cause flicker while
navigating within a site.  So now we're using nsIStyleSheetService
instead, but that has complexities of its own, such as being a global
setting rather than per-tab, and injecting the sitemap sheet before the
regular sheets (so often requiring !important to be added).

We had another idea which might be more elegant and flexible, but it
depends on what is - or could be - available in Firefox.

Now that FF supports Media Queries, we'd like to allow the author to
exploit them in terms of whether a sitemap is being presented.  For
example, the author could write:

<link rel="stylesheet" media="all and (sitemap)" href="extra-styles.css">

Our extension would then simply say (for a given tab) what the media
feature 'sitemap' currently evaluates to, and the FF machinery would
apply or withdraw rules in 'extra-styles.css' as appropriate.

Of course, 'sitemap' is not a recognised media feature according to the
MQ CR, but I believe that vendor prefixes are valid syntax for media
features and types, just as they are for CSS properties.  So instead, we
could write:

<link rel="stylesheet" media="all and (-sitemap-level)" href="extra-styles.css">

However, rather than defining arbitrary features and prefixes
willy-nilly, why not exploit URI namespaces?:

<link rel="schema.sitemap" href="http://standard-sitemap.org/" <http://standard-sitemap.org/>>
<link rel="stylesheet" media="all and (-sitemap-level)" href="extra-styles.css">

(Or in CSS:)

@namespace sitemap "http://standard-sitemap.org/" <http://standard-sitemap.org/>;

@media all and (-sitemap-level) { ... } 

The prefix 'sitemap' is then local to the file it's defined in, and the
extension doesn't have to go through any kind of formal registration
procedure (assuming it has a DNS name at its disposal).

Is something like this feasible within Firefox?  Obviously, it's much
more than our extension needs, as I've conceived it to avoid the need
for some form of registration (with Mozilla, or W3C, etc), but I hope
others will foresee other use cases.

Ideally, an API would exist where you could asynchronously specify the
value of a feature 'level' in a namespace 'http://standard-sitemap.org/'
for a given tab, and FF would do the rest (including handling 'min' and
'max' features).

Is there already an API on which this could be built?  If so, could one
extension be written to provide it to other extensions?

If this would need changes to Firefox itself, how should I pursue them? 
Where else should I suggest/propose them?  (And my apologies if this has
been the wrong forum...)

Thanks,

Steven
0
Steven
9/26/2009 5:27:53 PM
mozilla.dev.extensions 5694 articles. 0 followers. Post Follow

1 Replies
2347 Views

Similar Articles

[PageSpeed] 13

Steven Simpson wrote:
> @namespace sitemap "http://standard-sitemap.org/";
>
> @media all and (-sitemap-level) { ... }
>   

[snip rest of stuff which is evidently too weird ;-)]

> If this would need changes to Firefox itself, how should I pursue them? 
> Where else should I suggest/propose them?

Can anyone at least answer this bit?

Thanks!
0
Steven
10/15/2009 7:50:03 PM
Reply:

Similar Artilces:

superreview requested: [Bug 156716] CSS3 "media queries" : [Attachment 325870] patch 3: core of media queries (no dynamic change handling)
David Baron [:dbaron] (unreachable June 20-29) <dbaron@mozilla.com> has asked Boris Zbarsky (very little time until late May) <bzbarsky@mit.edu> for superreview: Bug 156716: CSS3 "media queries" https://bugzilla.mozilla.org/show_bug.cgi?id=156716 Attachment 325870: patch 3: core of media queries (no dynamic change handling) https://bugzilla.mozilla.org/attachment.cgi?id=325870&action=edit ...

superreview granted: [Bug 156716] CSS3 "media queries" : [Attachment 331224] patch 3: core of media queries (no dynamic change handling)
Boris Zbarsky (todo: 250+ items) <bzbarsky@mit.edu> has granted David Baron [:dbaron] <dbaron@mozilla.com>'s request for superreview: Bug 156716: CSS3 "media queries" https://bugzilla.mozilla.org/show_bug.cgi?id=156716 Attachment 331224: patch 3: core of media queries (no dynamic change handling) https://bugzilla.mozilla.org/attachment.cgi?id=331224&action=edit ------- Additional Comments from Boris Zbarsky (todo: 250+ items) <bzbarsky@mit.edu> Looks good. Note that I reviewed the interdiff, not this diff. ...

superreview requested: [Bug 156716] CSS3 "media queries" : [Attachment 331224] patch 3: core of media queries (no dynamic change handling)
David Baron [:dbaron] <dbaron@mozilla.com> has asked Boris Zbarsky (todo: 250+ items) <bzbarsky@mit.edu> for superreview: Bug 156716: CSS3 "media queries" https://bugzilla.mozilla.org/show_bug.cgi?id=156716 Attachment 331224: patch 3: core of media queries (no dynamic change handling) https://bugzilla.mozilla.org/attachment.cgi?id=331224&action=edit ...

superreview canceled: [Bug 156716] CSS3 "media queries" : [Attachment 325870] patch 3: core of media queries (no dynamic change handling)
David Baron [:dbaron] <dbaron@mozilla.com> has canceled David Baron [:dbaron] <dbaron@mozilla.com>'s request for superreview: Bug 156716: CSS3 "media queries" https://bugzilla.mozilla.org/show_bug.cgi?id=156716 Attachment 325870: patch 3: core of media queries (no dynamic change handling) https://bugzilla.mozilla.org/attachment.cgi?id=325870&action=edit ...

Namespace problem: extension not working after putting in own namespace
Hi all, I'm stuck with the namespace problem also. In fact, it's preventing my extension from getting out of the sandbox for half a year now. Unfortunately, the simple solution described on some web sites does not work for me: My extension is very simple, it just adds two buttons to the main toolbar. One of them enables/disables the extension while the other opens a popup window with a certain URL. After doing this namespace modification, the buttons stopped working: I can click on them, but nothing happens. Here is what I did: My main JS file is located in /chrome/content...

Namespace Query
Can i use access specifier with namespace keyword.Thanks and Regards,Aarti Malik Could you please elaborate on what you need? Perhaps show us an example of what you intend to do, so we can help you better? Please explain on your problem....... No you cannot. A namespace has no concept of public, private, protected, etc.  [C# MVP] Unblog|WebSite|IttyUrl...

How to Query A Query
I have been trying to build a crosstab report that reports everydate within a selected range across the top and specific row information. 7/1 7/2 7/3 . . . Name Detail1 Detail2 Detail3 Name Detail1 What I get as output is only the dates that contain information in the rows. I can get the information I need by using a query within a query (nested). Can a nested query be done in Informaker 5? What about version 6 or 7? Thanks for your help Convert your SQL to syntax, and you can write anything you want. So if your DB support...

Query about Queries
Hello all, As a relatively new user to Sybase I am hoping someone can point me in the right direction. We are getting ready to go live with our database and I am wondering what types of queries I should be running for system performance purposes. If anyone has any suggestions they would be more than appreciated. Thanks in advance, Jerry ...

namespace extensions
Hi, I was wondering why there isn't a namspace available for Mozilla browsers that allow you to execute Javascript during xsl transformation. Here's the thing: Microsoft has the following namespace extension : > <xsl:stylesheet > version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:msxsl="urn:schemas-microsoft-com:xslt" > xmlns:xslscript="myJavaScript"> > > <msxsl:script language="javascript" implements-prefix="xslscript"> > <![CDATA[ > ...

About the media query
Hi gaia folks~ i try to modify an old app such that it can be used on a qHD display device. The method i think of is to use media query in the css, so it looks like : @media (min-width: 540px) and (max-width: 540px) { html, body { font-size: 16px; } } By doing so i don't need to modify each and every block of my css files. But i am not sure this is the correct way to do it. Everyone can kindly shed some lights for me? Thanks Ellery ...

How to query a query...
I'm working on converting an Access DB that I created into an ASP.NET application (and attempting to learn ASP at the same time...). One of my queries was very complex and required running a different query first, and then working off of that one. Any suggestions on the best way to do this in ASP? The following is a sample of code I'm using so you can see the type of data-binding I'm using. Thanks for the help! myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " +"Data Source=" + Server.MapPath("/EquipmentCheckout.mdb")) strS...

Query a Query
I have a result set in a query. Is it possible to query this query? (no specific SQL dialect, can it be done generically?) Petros -- PETROS GAVRIELIDES wrote: > I have a result set in a query. > Is it possible to query this query? > > (no specific SQL dialect, can it be done generically?) There is a generic answer to your question: Yes, there is a construct called a sub-query that allows you, in 1 SQL statement, to query from a query. But, generically speaking, not all DB engines support this construct. For instance, Firebird only added it just over a y...

YaST says installation media not there expecting /dev/sda1 but it is on /dev/sdb1 ... then crashes
I run Yast to install new software... A dialog box pops up and informs me that the installation media cannot be found. I check the little box for more details, and there it says it is looking for /dev/sda1. The media is at /dev/sdb1. I correct it in the little form there, but the dialog box comes up again each time it goes to the disk. It does appear to install the data, BUT THEN, before running the post install scripts, the window just disappears. So though I install apache, the files are there but it is not running. Though I install postgress, there files are there but it i...

superreview granted: [Bug 248172] XMLSerializer corrupts namespace prefixes when XHTML namespace is used : [Attachment 151528] v1
Johnny Stenback <jst@mozilla.jstenback.com> has granted Johnny Stenback <jst@mozilla.jstenback.com>'s request for superreview: Bug 248172: XMLSerializer corrupts namespace prefixes when XHTML namespace is used http://bugzilla.mozilla.org/show_bug.cgi?id=248172 Attachment 151528: v1 http://bugzilla.mozilla.org/attachment.cgi?id=151528&action=edit ------- Additional Comments from Johnny Stenback <jst@mozilla.jstenback.com> sr=jst ...

Web resources about - Namespace prefixes for media queries - mozilla.dev.extensions

Namespace - Wikipedia, the free encyclopedia
Namespaces provide a level of indirection to specific identifiers, thus making it possible to distinguish between identifiers with the same exact ...

Wikipedia:Help namespace - Wikipedia, the free encyclopedia
The Help namespace is a namespace consisting of Wikipedia pages whose titles begin with the prefix Help: , such as Help:Link . These pages contain ...

ICANN seeks to tackle DNS namespace collision risks
As the number of top-level domains undergoes explosive growth, the Internet Corporation for Assigned Names and Numbers (ICANN) is studying ways ...

OS X Lion: Guidelines for connecting to a DFS namespace via SMB
Ensure that the following guidelines are followed when connecting to a DFS namespace via SMB in OS X Lion.

Facebook's Namespace Land Grab? Or Maybe…It's Just Useful
Much buzz over the past few days about Facebook’s plans to let folks (and, ahem, brands) claim their namespaces on Facebook. IE, Starting this ...

Global Namespace for People (Part 3)
I ended yesterday’s post by saying that I would write about potential solutions to the global namespace problem for people (parts 1 and 2). So ...

Netflix namespace problem · Issue #34 · balloob/pychromecast · GitHub
pychromecast - Library for Python 2 and 3 to communicate with the Google Chromecast.

Adding Namespaces To Ruby
... about how close I can get Ruby to look like Clojure in size and style. Recently, what has bothered me most has been how you define a namespace ...

PHP 5.6 features built-in debugger, better namespace support
PHP, the venerable scripting language for server-side Web development, has been upgraded in a point release highlighted by a new debugger.

#include<bits/stdc++.h> using namespace std; int n, x, y; int main() { fo - Pastebin.com
PASTEBIN - #1 paste tool since 2002 create new paste tools api archive faq PASTEBIN create new paste trending pastes sign up login my alerts ...

Resources last updated: 12/27/2015 12:42:38 AM