Original: Http://www.alistapart.com/articles/beyonddoctype
Author: Aaron Gustafson . Com
Translator: Zhaozy in 3user.com. Com
Reprint please indicate the author and translator information, thank you!
Progress always comes at a price. For Web browsers, users are spending a lot of money on the editors and browsers (especially Internet Explorer), as the developers advertise the truth in their breasts. When the browser launches a new version, it then fixes some errors and misconceptions about the specification (or introduces a new one), or changes behavior in any way. The site suddenly crashed, and then our customers, our bosses and users, felt very unhappy.
We might be able to spend some time explaining why our website is broken, but wouldn't it be better if they hadn't been compromised? Com
A little background introduction
Driven by the successful release of a better CSS-enabled Internet Explorer 7, the IE team began developing IE 8 in a new rendering engine (better followed by the CSS 2.1 specification). With their efforts, browsers have been able to show a fairly accurate "Acid2 test" (http://webstandards.org/action/acid2/). The information you follow up means that IE will quickly support URLs that generate content and data, and confirmed that Haslayout will be canceled forever. Its performance results will allow other browsers to vote through the ACID2 test (including Safari, Icab, Konqueror, and Opera.) Firefox3 has also passed the Acid2 test, but was not released when the article was written.
In the new engine development process, IE team remember IE 7 after the release of the negative evaluation. Some web-standard enthusiasts and even some of Microsoft's admirers feel that they are not doing enough in "IE7" (bug fixes and CSS support improvements). But there are a large group of developers who are puzzled because their site is perfect in IE6, but IE7 completely collapsed. Web standards advocate Roger Johanssen in his blog "The three main reasons why pages are broken" (Http://www.456bereastreet.com/archive/200611/three_reasons_sites_ break_in_internet_explorer_7/), which drives everyone to improve support for the standard. The IE development team discovered the 4th: Document type conversion (DOCTYPE switch), a core technology that enables modern CSS layouts with fatal flaws in logo compatibility.
The document type converter is invalid
Back in 1998, Todd Fahrner's "came up with a toggle" (http://web.archive.org/web/20030212115103/http://www.geocrawler.com/ archives/list-name.mbox/123/1998/7/0/1037920/) "method allows a browser to provide two sets of rendering modes: one for developers who expect to follow the standard, and one for everyone else. This view is pithy and simple. When a client agent encounters a document that is well defined for a DOCTYPE declaration of the current HTML standard (that is, HTML2 does not cancel it), the creator knows what she is doing and renders the page in standard mode (with the box model element layout of the Web). However, when there is no DOCTYPE or an incorrect DOCTYPE is defined, the document is rendered in "Quirks" mode, which means that the element is laid out using the Windows version of the ie5.x non-standard box model.
This concept was first used in the Mac version of IE two years later, this approach is quickly adopted by other browser makers, realizing that standard developers will include the correct DOCTYPE in their documents, so that their part does not require additional work when the browser renders it to the specification. Non-paying attention to standard developers are happy, they themselves did not find that they and their tools have not inserted the correct DOCTYPE for them, but their documents in the browser has been specially treated. Web Teaching Network
Unfortunately, because of the two key issues, DOCTYPE cannot continue to act as a standard mode converter for the vast majority of calls:
- A List of apart and the promotion of Web Standard projects, the good editor developers began inserting valid, complete doctype into the tags generated by their tools.
- IE6 's rendering behavior has not been updated for 5 years, which makes most developers think the engine is correct and is unlikely to change.
Both of these situations undermine DOCTYPE's conversion because it has a fatal flaw: Using effective doctype means you understand what you're doing with web standards, and you want to get more accurate rendering, but how do we know it failed? When IE 7 arrived, the site changed.
Of course, as Roger points out, some of the damaged sites are using IE6-specific CSS Hack (usually without the opportunity to offer a choice). But such tragedies occur because their developers only test their pages in IE6, or they only care about what their websites are like in IE6. Because they develop websites for groups that use the same kind of browsers (for example, the company's intranet). Now of course, you can just shrug and say, this is proven to be IE6, but these developers should know more, but you'll overlook the fact that the developers never explicitly chose "standards mode", even though they knew there was a pattern.
Chris Wilson, the graphic architect of Internet Explorer, often mentions one of the core principles developed on IE: the goal of any choice made by the IE team is definitely not to "break the page". Sadly, IE 7 lets many people face this fact. Microsoft is unwilling to make a second mistake, Microsoft has started to enter the Web Standard project (I am one of them), and several other standard-conscious developers have asked us for help to find a good way to allow developers to choose to support web standards on their own. The ultimate goal is to find a way to be more direct and clear than the DOCTYPE selector, which can be applied to any browser, not just ie.
Web Teaching Network
A better future
In last year's SXSW, I was fortunate enough to see the magical issue of Carrie Bickner, the New York Public Library, who led the Jeffrey Zeldman's wife of Ala's publisher. "Preserve our digital heritage and our personal collection" to discuss the problems that libraries and individuals face in maintaining digital archives. Most of the problems stem from the progress of file formats and applications: Microsoft Office 2007, for example, does not reliably present a document of Word 1.0 that could have been presented. This topic reminds me of how Web pages will change as they begin to build, and how they will change as the Web standards progress.
As a supporter of Web standards, I want to see that browsers are constantly improving to standardize while providing new support. At the same time I saw the importance of protecting the Web site that we had worked so hard to build on the table layout. Of course, most of the bugs that pass through the "Wayback Machine" are not hit by the fact that DOCTYPE converters can still serve them well, but what about Web sites that let IE 6 perform "standards" mode? I also know that in many cases, IE 7 can not fully render them. Does this mean that we need to keep a copy of IE 6 on hand, in order to browse the Web page to achieve the same effect as the creator wants? This is what a lot of libraries do to browse old documents. In the era of IE 8, we also face these potential problems, the use of IE 7 of the rendering engine generated by the normal document will be in IE 8 shape, how to solve this problem? Com
[1] [2] [3] Next page