Responsive Web Design

Ethan MarcotteResponsive Web Design布丁爸爸說這是 2010 上半年最重要的文章之一

內文主要是在闡述一個重要的 Idea:「Responsive Web Design」。隨著 Web 從 PC 螢幕移動到各式各樣的裝置,為每個裝置設計不同的網站版本(iPad 版、iPhone 版、手機版)是個 viable 但是不 scalable 的解決方法。作者認為,網站開發時如同「Responsive Architecture」的概念一樣,讓環境去適應使用者的存在 -- 像是自動調節室內溫度、將窗戶霧化以保護隱私等。網站設計不應該是平面出版的電子化,存在於固定的版面、文字大小、圖文配置;設計應該要自然的適應不同的裝置,自動調整版面的 flow,甚至是互動 UI 的大小等等

實作的細節,作者花了後半的篇幅在介紹 CSS media query。Media Query 是以前 CSS 2 的 media type 延伸,不同的是它不只是一組預先設定好的媒體(螢幕、紙本、點字、語音…),它可以讓開發者自行設定 CSS 規則適用的裝置類型、寬度等等。文章內提供了具體的範例,展示了使用 Media Query,作者可以指定當裝置的螢幕寬度小於多少、或是介於多少時,網頁可以隨之切換欄數、圖片寬度、圖文配置等等。

我自己把文章印了出來(地球對不起 > <),認真讀了一遍,滿有收穫的。雖然 CSS media query 是早就知道的東西,但是不了解前面的設計哲學與意義就不會有動機去玩它(現在就超有動機的哈)。作者的文筆讓人耳目一新,闡述概念的方式相當的生動,可以拿來練英文(真的)。

有個研伸的問題,作者也有簡略提到。CSS media query 解決了排版適應裝置畫面的問題,但如果開發者希望在不同裝置呈現不同的內容,甚至不同的互動時,多版本網站還是解法。如果只是幾行字,或許可以用 display 屬性開關切換掉,但總不會 Facebook 套了另一份 CSS 就變成 Facebook for touch devices:P

知識信用與 HTML5

Chris Blizzard 的文章 intellectual honesty and html5,正中我上篇文章講的 Apple 如何假裝開放實際上還是在做 vendor locked-in 的陰謀(陽謀?)。只是這次做的太明顯然後就翻船了。

Blizzard 主要的論點是 Apple 竟然大聲說他們喜歡創新的網路,那出來的產品跟作法就要言行一致 -- 尤其是 HTML5 這一系列的創新本身的目標之一就是互通性 -- 不能到處廣告說 Safari 支援 HTML5 然後故意把其他也支援的瀏覽器從示範網頁排除掉;這種顯然是沒有信用、不誠懇的傳遞知識的做為。

Mozilla 的 Sayre 做了一個很酸的 HTML5 demo,哈哈哈 (當然不代表 Mozilla 的立場)。

iPad Ready? iPad Only?

My fellow Web Developers, I know it’s exciting to work with new devices and experimenting with new interactions, like multi-touch. I also acknowledge that sometimes it’s best to have a special look-and-feel that fit the device. But this time Apple is deliberately hurting the open web.

Yes, you must have heard the phrase “iPhone is the new IE6″; back then I think Apple was doing a great job bringing the web as-we-know-it (kind of) to the mobile, and the cost to develop a separate iPhone website is justify because it’s mobile – a distinct device. Yet, for iPad it’s a completely different story:

  • No matter how Apple marketed it, the device is an 1024×768 tablet, with enough screen size to fit regular web.
  • Even if I want to build a specific website for iPhone/iPad, their devices doesn’t use open standard like CSS @media-query to identify themselves their device does do that, but not yet adopt by most developers. In fact, the way noteworthy companies doing the identification (e.g. Google’s GMail) is by detecting UA string. I couldn’t stop imaging the string iPhone or iPad would one day present in every mobile browser, just like the string Mozilla did. The <meta viewpoint> spec was also poorly designed – Apple should be more careful if they intend to establish a new de-facto standard.
  • For all the things above, I could just make excuses for them, like I did with iPhone Safari: it’s one of it’s kind, and Apple is focusing on delivering the best user experience they could give (like we all do) – but not for this: the flashy shrine of iPad-ready websites. Apple is purposely asking web content providers to build websites for it’s garden – and guess what, the garden is walled due to constraint above.

Web is the first platform without a vendor. Nobody want to market a term they cannot trademark; every vendor of the market-leading browsers – from NCSA Mosaic, Microsoft Internet Explorer, to Apple iPad/iPhone Safari now, want to make World Wide Web their own from simply replace the terminology*, break the content standard, to moving open content to their closed garden.

Let’s defend that, first by giving your iPhone/iPad ready website an independent universal-accessible address, then demand browser vendors provide feasible standard to address their device capacities. No more UA string hacking please.

* Little-known early history of WWW; Back then, NCSA promotes their Mosaic browser without even mentioning the term “WWW”. This gesture prompted Sir Tim Berners-Lee to fund W3C to ensure the openness of the Web. More stories can be found on his book “Weaving the Web.”

CNNIC certificate criss: what you should do

Disclaimer: I am a Mozilla Taiwan Community contributor, however the followings are my own point of view; not the view of entire community.

中文版貼在 Mozilla Links

So, now we got bug 476766 calling Mozilla to remove CNNIC CA certs from it’s codebase, and people posted over on how to remove it manually. Personally I agreed with the objective argument in the bug, that officially CNNIC is considered innocent until proven guilty. To make my point, here is a PhotoShop MS Paint mock up for you. Please stop the nonsense in bug 476766 unless you see this:

But if you do, please immediately click [Detail...] and export the fake SSL cert. Every responsible browser vendor, include Mozilla, will remove the CNNIC Root upon this goes public, and the fake certificate would be the biggest scandal of the year to China, on the Internet.

What you should do before that

If you feel unsafe on the standard practice of browser vendors, you could disable the CA certs in your computer. Mozilla is correct on not-removing the CA certs, but for user who want to remove them themselves, I don’t think Mozilla has provided an easy tool for that. Clicking Tools – Options – Advanced – Security – Certificate Manager is just too painful. So here is an add-on I wrote which does that for you: CA Untrustworthy. Do remember that removing CNNIC CA certs will break legit CNNIC-signed websites.

For the less paranoid, Rex provided us an add-on “Cert Alert” that alerts user whenever they encountered an CNNIC-signed website. Install it, after that, when you see the alert, you could use your judgment to consider the trustworthiness of the website – you might actually find the fake SSL cert that way.

Firefox 5 Birthday!

要怎麼形容我們這個社群在幹麻呢?最近因故又遇到了這個問題。不過也是剛好正在翻譯Firefox 五週年!網站的文案,發現文中的描述的概念很簡單,卻很精確:我們希望人人的網際生活體驗能變的更美好。

不管你有沒有在用 Firefox 或是覺得它好不好用,Firefox 五年的存在的確讓 web 變的更好;即便不是市場上的 dominant force,但鳳凰的重生(*)的確驅使了新的技術進步,與隨之而來的網路應用。想想看,下個五年我們能一起成就什麼?

* 參考 about:mozilla

技術筆記: 這個網站 (project 代號 [Fyfx]) 我貢獻了中文 embedded font 的部份(標題後面的「五週年!」三個字),其中用到了 tka 的神妙 script,把 Droid Sans 字型 (3MB) 裡面會用到的字抽出來組 subset 字型 (16KB) 的技術。用 Droid 是因為版權,還有要同時讓簡繁日韓四個 locale 都能使用;我知道寫法和繁體標準字不一樣,不過這是 trade off。

當然要感謝 tka 大大的幫助!

對一件事的看法不等於這個人的全部

pingooo:

我不知道別人怎麼看,我只會把文章當作格主對一件事的個人意見,人是複雜的,對一件事的看法[不等於]這個人的全部;如果台灣的 open source 界對你會有這種不能講真心話的同儕壓力,真是 open source 的悲哀。也是不尊重個人意見的表現。

via.

這個 Blog 不怎麼有名,至今也沒發生什麼大事情。不過不讓我在這裡暢所欲言的阻力的確是這個。回去翻翻那些我寫的欲言又止的文章吧。

如果台灣所有人都有葉平教授的胸襟就好了 —— 反過來說,如果部落格無法成為理想的公民媒體與民主深化的力量,大概就是因為這個。