惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
S
Secure Thoughts
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News | PayPal Newsroom
Application and Cybersecurity Blog
Application and Cybersecurity Blog
O
OpenAI News
S
Security @ Cisco Blogs
宝玉的分享
宝玉的分享
Hacker News: Ask HN
Hacker News: Ask HN
T
Troy Hunt's Blog
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
TaoSecurity Blog
TaoSecurity Blog
Help Net Security
Help Net Security
Latest news
Latest news
NISL@THU
NISL@THU
S
Security Affairs
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 聂微东
AI
AI
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
小众软件
小众软件
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
AWS News Blog
AWS News Blog
W
WeLiveSecurity
Google DeepMind News
Google DeepMind News
I
InfoQ
Schneier on Security
Schneier on Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
T
The Exploit Database - CXSecurity.com
IT之家
IT之家
T
Threatpost
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
腾讯CDC
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
N
News and Events Feed by Topic
L
LINUX DO - 最新话题
F
Full Disclosure
大猫的无限游戏
大猫的无限游戏
H
Heimdal Security Blog
S
SegmentFault 最新的问题

David Baron's Weblog

Software engineering, responsibility, and ownership Software engineering, responsibility, and ownership David Baron's weblog: Security and Inequality Running animations on the compositor thread David Baron's weblog: Tying ecosystems through browsers David Baron's weblog: Payments on the Web Thoughts on migrating to a secure Web David Baron's weblog: The need for government David Baron's weblog: Priority of constituencies How browser developers should seek feedback from Web developers A possible approach to shorter release cycles David Baron's weblog: Fifteen years Why debug builds (and assertions) are important Ten years of the Mozilla Foundation Open licensing at the W3C Why adding compositing and blending to CSS is harder than it looks How you can help with removing -moz- prefixes Moving bug history out of the primary display of a bug report Beware of locale-specific behavior in the C library Eating dogfood and shipping software Specification style and the future of the Web The bug system I wish I had Improving font size readability on Firefox for Android David Baron's weblog: CSS Animations, part 2 Hue-preserving color inversion with SVG filters Changes to handling of @-moz-keyframes David Baron's weblog: window.matchMedia() David Baron's weblog: CSS Animations What does a blur radius mean? Crash analysis in the future David Baron's weblog: calc() David Baron's weblog: colorDepth David Baron's weblog: Hidden complexity in specifications The most important field in a bug report: the summary WOFF font format submitted to W3C David Baron's weblog: :-moz-any() selector grouping setTimeout with a shorter delay Faster repainting in SVG foreignObject David Baron's weblog: Distributed Extensibility David Baron's weblog: Broadening crash analysis Correlating crashes with binary extensions or plugins David Baron's weblog: ex-HTML Downloadable font formats for the Web Web Accessibility as a Political Movement David Baron's weblog: CSS priorities David Baron's weblog: Bug priorities David Baron's weblog: Semi-vacation Some new CSS features in Firefox 3 David Baron's weblog: New selectors David Baron's weblog: The age of bugs Seeking a good Linux distribution David Baron's weblog: Teaching to the test David Baron's weblog: March 2008 David Baron's weblog: February 2008 David Baron's weblog: January 2008 David Baron's weblog: October 2007 David Baron's weblog: September 2007 David Baron's weblog: August 2007 David Baron's weblog: June 2007 David Baron's weblog: April 2007 David Baron's weblog: March 2007 David Baron's weblog: January 2007 David Baron's weblog: September 2006 David Baron's weblog: August 2006 David Baron's weblog: July 2006 David Baron's weblog: May 2006 David Baron's weblog: February 2006 David Baron's weblog: January 2006 David Baron's weblog: December 2005 David Baron's weblog: October 2005 David Baron's weblog: September 2005 David Baron's weblog: June 2005 David Baron's weblog: May 2005 David Baron's weblog: April 2005 David Baron's weblog: March 2005 David Baron's weblog: February 2005 David Baron's weblog: October 2004 David Baron's weblog: September 2004 David Baron's weblog: August 2004 David Baron's weblog: June 2004 David Baron's weblog: May 2004 David Baron's weblog: April 2004 David Baron's weblog: March 2004 David Baron's weblog: February 2004 David Baron's weblog: January 2004 David Baron's weblog: November 2003 David Baron's weblog: October 2003 David Baron's weblog: September 2003 David Baron's weblog: August 2003 David Baron's weblog: July 2003 David Baron's weblog: June 2003 David Baron's weblog: May 2003 David Baron's weblog: April 2003 David Baron's weblog: March 2003 David Baron's weblog: February 2003 David Baron's weblog: January 2003 David Baron's weblog: December 2002 David Baron's weblog: November 2002 David Baron's weblog: September 2002
CSS border-image changes and unprefixing
David Baron · 2012-06-13 · via David Baron's Weblog

The border-image property lets CSS style sheets specify a border using an image rather than using one of CSS's predefined border styles. The style sheet gives a single image: and the measurements for splitting that image up into 9 pieces: and the 9 pieces get stretched or tiled as requested to form the element's border:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

In Firefox 15 we're planning to ship changes that update our support for border-image from the 2008 Working Draft to the 2011 Candidate Recommendation. (Note that we have not yet added the new feature that was added in the 2012 Candidate Recommendation, border-image-repeat: space.)

The border-image property is now a shorthand, and has longhand subproperties called border-image-source, border-image-slice, border-image-width, border-image-outset, and border-image-repeat. For Gecko, border-image-width and border-image-outset are new features that we didn't have before.

Together with these changes, we're unprefixing our support for border-image. We're planning to continue to support -moz-border-image for now (but with the updated behavior, not the old behavior). However, since we have never shipped a release with -moz-border-image-source or any of the other subproperties, we will not be adding prefixed support for them, since there's no compatibility reason to do so.

At the same time we're also making two significant incompatible changes made by the CSS Working Group. I believe these changes are already implemented in IE10 and in WebKit's unprefixed implementation. I believe current Opera and WebKit's prefixed implementation still follow the old rules.

  • First, the border-image no longer shows the middle section of the image by default. In order to show the middle section of the image, the fill keyword must be used in the border-image-slice property or in the shorthand.
  • Second, the ability to override the border widths (as determined by border-*-width and border-*-style) within the border-image property has been removed, and its place in the syntax, following a /, has been taken by the border-image-width property, which allows specifying the width that the border image slices will occupy so the slice boundary need not line up with the boundary between the border area and padding area

This means that if authors want to be compatible across browsers both before and after these updates, they should, I think:

  1. Use only the shorthand border-image, and not the new longhand border-image-* properties.

  2. When there are non-transparent pixels in the center slice of the image, authors should use the fill keyword only in the unprefixed declaration, like this:

      -moz-border-image: url(my-border.png) 30 30 30 30 stretch stretch;
      -webkit-border-image: url(my-border.png) 30 30 30 30 stretch stretch;
      -o-border-image: url(my-border.png) 30 30 30 30 stretch stretch;
      border-image: url(my-border.png) 30 30 30 30 fill stretch stretch;
  3. Authors should not use any capabilities in the shorthand that require the use of the /. In particular, authors using the / in the old syntax should replace its use with the border-width property (containing the widths that follow the slash) and also a declaration of border-style: solid (and probably also an appropriate border-color declaration for browsers that don't support border images at all).

    For example, something that authors were previously writing as:

      -moz-border-image: url(my-border.png) 30 30 30 30 / 2em stretch stretch;
      -webkit-border-image: url(my-border.png) 30 30 30 30 / 2em stretch stretch;
      -o-border-image: url(my-border.png) 30 30 30 30 / 2em stretch stretch;
      border-image: url(my-border.png) 30 30 30 30 / 2em stretch stretch;

    should now be written as:

      border: 2em solid transparent; /* or other fallback color */
      -moz-border-image: url(my-border.png) 30 30 30 30 stretch stretch;
      -webkit-border-image: url(my-border.png) 30 30 30 30 stretch stretch;
      -o-border-image: url(my-border.png) 30 30 30 30 stretch stretch;
      border-image: url(my-border.png) 30 30 30 30 stretch stretch;

For more details, see: