W3C home > Mailing lists > Public > www-style@w3.org > July 2013

[css-shapes] Using the rendered element as image source

From: François REMY <francois.remy.dev@outlook.com>
Date: Thu, 11 Jul 2013 18:07:07 +0200
Message-ID: <DUB120-W29915B81B617893DB8BCE5A57B0@phx.gbl>
To: "www-style@w3.org" <www-style@w3.org>
While I was reviewing the css-shapes spec, I came accross this sample {see below} that I believe isn't very good practice because it's actually mixing content and styling by replicating the image source in the CSS styling.

  
    <img id="CSSlogo" src="CSS-logo1s.png"/>
    blah blah blah blah...
  <BR>
  
  <style>
    #CSSlogo {
      float: left;
      shape-outside: url("CSS-logo1s.png");
      shape-image-threshold: 0.1;
      shape-margin: 35px;
    }
  </style>

I'm also worried that the sizing of the image can be controlled by a "width" or a "height" declaration somewhere else in the CSS files and that the shape-outside algorithm might just end up working on the same image but with a different scaling factor, making the result incorrect.



Wouldn't it be a good idea to support

  <style>
    #CSSlogo {
      float: left;
      shape-outside: from-rendering; // and also "from-background"
      shape-image-threshold: 0.1;
      shape-margin: 35px;
    }
  </style>

? 

Are there perf issues or particular circular dependencies that make that hard to implement?


_________________________

PS: I envision "shape-inside: from-background" to be quite popular when "shape-inside" will become supported. 

PS2: Shouldn't "shape-margin" and "shape-image-threshould" be correctly namespaced as "shape-outside-margin" and "shape-outside-image-threshould"? 		 	   		  
Received on Thursday, 11 July 2013 16:07:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC