Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
GNOME GUI Graphics Programming Software IT Technology

WebKit For Metacity/Mutter CSS Theming? 124

An anonymous reader writes "As Metacity (the GNOME window manager) evolves into Mutter, the question of CSS themes and how to implement them has come up. One of the proposals was WebKit, which the author asked more specifically about on his blog. It seems that WebKit, being a very fast rendering engine, would allow Mutter to have unprecedented power, not to mention being nearly future-proofed. As a major bonus, going this way could allow GNOME to share themes with KDE, which is apparently already headed towards a dependency on WebKit. Many people will reflexively recoil at the idea of a browser being mixed with a window manager. But it's important to remember that WebKit is not a browser — it's just a rendering engine, and it's not where all the security issues come from. So, what are the real technical issues at stake here? What are the pros and cons of using WebKit underneath GNOME rendering?"
This discussion has been archived. No new comments can be posted.

WebKit For Metacity/Mutter CSS Theming?

Comments Filter:
  • Make it happen so that Open-Source OS's can move onto standardizing the more important OS API's without having to worry about having a standardized theming schematic that is powerful and unbiased towards any visual toolkit or desktop environment. Hopefully after everyone adopts this I can make apps from one gnome look good in kde and vice versa already...
  • No problem (Score:5, Funny)

    by Reed Solomon ( 897367 ) on Sunday July 19, 2009 @09:15PM (#28752071) Homepage

    As long as it keeps my desktop active, like some sort of active desktop, then it's all good.

  • No more CSS (Score:5, Interesting)

    by intx13 ( 808988 ) on Sunday July 19, 2009 @09:27PM (#28752129) Homepage
    CSS barely functions on the platform for which it was intended, and now you want to bring it to a platform that has well-established, functional, themeable rendering engines already in existence?

    CSS was intended to let designers seperate from function from form - how is that lacking in current themeing environments? The linked blog contains a laundry list of features that are in CSS that are not applicable to desktop themes and features that are not in CSS that are necessary for desktop themes. What I don't see is a list of features that CSS brings to desktop themes that are impractical in existing systems.

    Let's see: a system that barely works on its intended platform that contains functionality not applicable to the new, suggested platform and is missing functionality necessary on the new, suggested platform. Gee, sounds like the right technology for the job!
    • by wisty ( 1335733 )

      It's a pity that your post is so far down the list.

    • Wow, the government is getting more and more involved in open source every day

    • Person A: What shall we use to fill this round hole?
      Person B: I've seen this really cool square peg someone made!
    • WTF? No more CSS? (Score:5, Informative)

      by mcrbids ( 148650 ) on Sunday July 19, 2009 @11:39PM (#28752947) Journal

      I'm not sure I understand how you start by saying that CSS barely works for the target environment - BILLIONS of web pages are served every day in a (relatively) cross-platform fashion.

      Many of these are rather good looking, too.

      So I'd have to argue that CSS doesn't work. The areas where CSS is weak consist primarily of CSS specs that have NOT been implemented (*ahem* IE) or implemented in a bone-headed way (*ahem* IE) not in areas of weakness within the CSS spec itself.

      Perhaps the most amazing thing about CSS is how trouble-free its implementation has been, and just how smooth the transition actually has been.

      Old stuff still basically works, new stuff just basically works better.

      But while we're at it, we should also pay homage to KDE, Konqueror, and its many progeny. KDE begat Konqueror. Konqueror begat Webkit, which has begat (among too many other web-like to mention) Chrome/Chromium and Safari. And just about everybody who has worked on or with Webkit has raved about its clean design and crisp implementation.

      So, we must give kudos to the excellent KDE team who has produced a product that is just now starting to give Mozilla / IE a run for their money, without all the funding by AOL for all those years.

      Good job, KDE team!

      • by tyrione ( 134248 )
        Konqueror did not begat WebKit. KHTML/KJS begat WebKit.
      • by moosesocks ( 264553 ) on Monday July 20, 2009 @12:07AM (#28753091) Homepage

        Try using CSS for a while, and you'll see that its creators left out some frankly baffling features, such as the ability to center an element.

        The 3 major implementations (Mozilla, WebKit, and IE) all had major differences in their first versions (with none of them implementing the spec properly!)

        Other features that (dead tree) page designers would find extremely common were left out as well (hyphenation and columns being my biggest personal pet peeves)

        Currently, there's a big push to do applications and graphics using CSS and Javascript, which have resulted in WebKit and Mozilla adopting a set of proprietary CSS attributes that aren't part of the standard.

        Don't get me wrong -- style sheets were an absolute godsend to web development. However, both the standard (and the implementation of that standard) are crap. Metacity would be much better off taking NeXT/Apple route, and using a PDF/PostScript derivative.

        • by am 2k ( 217885 )

          Don't forget the inability to do simple math (like center+10px, bottom-50px). How are you supposed to separate style from content when you need blank divs to simulate space calculations?

          • Actually, I'll mildly disagree with you on this one: It *would* be nice for CSS to be able to do simple math, although JavaScript is perfectly adequate for the task.

            Of course, JavaScript has more than a few of its own irritating deficiencies, although JQuery [jquery.com] makes the language considerably more tolerable, and makes CSS manipulation a breeze. JQuery should have been part of JavaScript from the start!

            • You need to do the math in CSS because CSS knows how big a "em" is at runtime, and Javascript doesn't.

              Take an example where you want a box to be "5em + 10px" tall. How could you do that in Javascript? (I guess you could set it to just 5em and then use JS to determine it's existing pixel size, then add 10px, then re-set the style, but man-- talk about a hack! And it wouldn't work when the user resized the font, unless they also reloaded the page.)

          • I'm a little out of practice with CSS so I may be missing something obvious, but is there some reason you can't do something like align: center, padding-left:10px to create the same effect as center+10px?

        • by julesh ( 229690 )

          Try using CSS for a while, and you'll see that its creators left out some frankly baffling features, such as the ability to center an element.

          You mean, like margin-left: auto; margin-right: auto;? Or text-align: center?

          I agree that CSS has some startling issues, but this isn't one of them.

          • Sure, it can be done, but it's not very logical.

          • by marnues ( 906739 )
            Those are hacks, not actual centering. They only work on certain elements and if you have to use any other hackery, they rarely work as desired. I've ended up using massive amounts of javascript just to keep a dynamic menu centered at the top of a page. I think there's a lot of websites out there that don't center things like menus because it's too much work. And we want this to be the language of desktop formatting?
      • Re: (Score:1, Insightful)

        by Anonymous Coward

        I'm not sure I understand how you start by saying that CSS barely works for the target environment

        Just look at what you have to do to make rounded corners. (This seems especially relevant for WMs :) )

      • I'm not sure I understand how you start by saying that CSS barely works for the target environment - BILLIONS of web pages are served every day in a (relatively) cross-platform fashion.

        That doesn't mean it doesn't "barely work." Hell, CSS doesn't have variables, it can't do math, it took until version 3 to get extremely basic, obvious features like columns... it's god-awful. "Barely works" is appropriate in my opinion.

        So I'd have to argue that CSS doesn't work. The areas where CSS is weak consist primarily

  • With all this pissing and moaning about Webkit vulnerabilities and whatever, you are forgetting that there almost certainly will be an API which goes between webkit and the the WM (and possibly more APIs on top of that!) which not only makes interfacing with the WM and the rendering engine easier but it also should restrict the amount of stupid things that you can do!... or rather the amount of things that malicious code can do.

    Ah... I forgot. Everybody on Slashdot codes in binary (and the noobs use assembl

    • Pfft, BINARY? Back in my day we didn't have a full supply of 1's for every damn kid! We had to ration 'em out. Through most of school, I was coding with mostly 0's, 1's were few and far between (I remember getting a pack of 10 for christmas one year)! Now, get off my lawn! :)
      • You jest but perhaps you do not know how close you are. The original Manchester computer (Manchester UK that is) used teletypes for input and output, and they could not afford to change the balls. Baudot code is, to say the least, nonobvious. So 5-bit binary zero printed out as / and because this was the default state of the memory, early printouts consisted mainly of pages full of slashes.

        It's said that when they gave their first presentation in London, most people present knew nothing about computers and

        • Thank you for inadvertintly making me right. That so rarely happens to me. :) Also, yay for learning something new!
  • by Anonymous Coward

    It seems that WebKit, being a very fast rendering engine, would allow Mutter to have unprecedented power, not to mention being nearly future-proofed.

    Maybe I'm old-fashioned, but I'm not really seeing why we need so much power or future-proofing in a window manager. The window manager is responsible for... what, drawing title bars and window frames? Can someone explain to me what part of that needs future-proofing or would benefit in any way from an HTML rendering engine? It's not that I disagree, I hones

    • by Toonol ( 1057698 )
      I think the eventual goal is to beat windows by having Linux run INSIDE of Firefox. Turning the desktop into a browser window is the first step.
    • Re: (Score:1, Insightful)

      by Anonymous Coward

      It seems that WebKit, being a very fast rendering engine, would allow Mutter to have unprecedented power, not to mention being nearly future-proofed.

      Maybe I'm old-fashioned, but I'm not really seeing why we need so much power or future-proofing in a window manager. The window manager is responsible for... what, drawing title bars and window frames? Can someone explain to me what part of that needs future-proofing or would benefit in any way from an HTML rendering engine? It's not that I disagree, I honestly don't see the purpose or logic at all. I mean, if the GNOME guys decided to replace Gtk+ with WebKit... well, I think it'd be a lousy idea, but I could see the reasoning. This just completely baffles me. It's like if I suggested replacing a bookshelf with a refrigerator. OK, I guess you can put books in a refrigerator if you want; it does have shelves. And I suppose if you happened to have some books which needed to be kept cold, well, that'd be a big plus. Maybe putting an old book in the vegetable crisper would keep it in better condition longer.

      But seriously, I'm not sure I've ever seen such a shining example of a solution looking for a problem.

      I think the future they're proofing against is people adding arbitrary widgets to everything and then wanting them to inherit properties from the general theme.

    • Re: (Score:2, Insightful)

      by Flossymike ( 461164 )

      Just a random thought off the top of my head, but would using css potentially help with technologies such as screen readers for the blind? Also, as you could have named areas, does it open up areas which can be set as preferences, for instance deciding that you prefer to have menus always at the top of the screen.

      Just my 1p

  • There are a whole lot of rendering engines out there, why choose one with an HTML API?

    As a hypothetical alternative, OpenGL is also a perfectly good rendering engine, why not use it? It is just as ubiquitous, it supports every conceivable rendering operation one would ever want to perform. Nothing can touch it in the efficiency department. There are OpenGL bindings for many languages. There's even the new javascript OpenGL binding.

    If I was going to choose a rendering engine, I would look first at its AP

    • by Homburg ( 213427 )

      There are a whole lot of rendering engines out there, why choose one with an HTML API?

      Yes, the API seems to me to be give the lie to the idea that WebKit is just a rendering engine, not a browser. If you look at the API [webkitgtk.org], it's very clearly designed to power a browser-style application. If it exposed an API that you could pass a DOM tree and a list of CSS styles, and get back a pixmap rendering, that might not be a bad backend for a theming system. But WebKit doesn't expose that low-level API, rather, its API is based around loading whole HTML pages.

  • by Anonymous Coward

    would allow Mutter to have unprecedented power,

    Unprecedented? It's not as if Windows didn't integrate the browser/rendering engine into Active Desktop, back in what, 1995? And surely Symphony OS never implemented a gecko-based desktop manager.

    • Re: (Score:3, Insightful)

      by haruchai ( 17472 )

      Active Desktop was part of or released with IE4, probably in mid-97. Too bad it sucked system resources so hard and was so unstable

      • And since Microsoft already tried it and failed, all other attempts should be squashed... because Microsoft is the epitome of efficiency and speed and therefore cannot be beat!

  • WebKit ships with QT. KDE depends on QT.

  • Adapting CSS to work for UI skinning is a good idea. It leverages very common knowledge and works based on a powerful model.

    Implementing this by shoehorning an entire Web rendering engine into a window manager is not a good idea. By definition it means including a huge amount of unrelated and unneeded functionality, any or all of which could contain bugs. Witness the lessons of Display PostScript in NeXTStep, which introduced security problems due in no small part to including far more than was needed for t

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...