| <!doctype html> |
| <html> |
| <head> |
| <style> |
| body { |
| font-family: monospace; |
| } |
| p { |
| margin: 0; |
| } |
| |
| .container { |
| width: 10em; |
| height: 5em; |
| background-color: lightgray; |
| margin-top: 1em; |
| } |
| |
| .content { |
| width: 3em; |
| margin-left: 0.25em; |
| height: 10em; |
| float: left; |
| } |
| |
| #f1 { |
| -webkit-flow-into: flow1; |
| } |
| .r1 { |
| -webkit-flow-from: flow1; |
| } |
| @-webkit-region .r1 { |
| .c1 { |
| background-color: lime; |
| } |
| #d1 { |
| background-color: green; |
| } |
| } |
| |
| #f2 { |
| -webkit-flow-into: flow2; |
| } |
| .r2 { |
| -webkit-flow-from: flow2; |
| } |
| @-webkit-region .r2 { |
| div { |
| background-color: lightgreen; |
| } |
| } |
| |
| #f3 { |
| -webkit-flow-into: flow3; |
| } |
| .r3 { |
| -webkit-flow-from: flow3; |
| } |
| @-webkit-region .r3 { |
| div { |
| background-color: lightgreen; |
| } |
| .c3 { |
| background-color: lime; |
| } |
| #p3 { |
| background-color: green; |
| } |
| } |
| </style> |
| </head> |
| <body> |
| <div id='f1'> |
| <style scoped='true'> |
| div { |
| background-color: lightgreen; |
| } |
| </style> |
| <div class='content'>Line of text</div> |
| <div class='content c1'>Line of text</div> |
| <div class='content' id='d1'>Line of text</div> |
| </div> |
| <div id='f2'> |
| <style scoped='true'> |
| .c2 { |
| background-color: lime; |
| } |
| #d2 { |
| background-color: green; |
| } |
| </style> |
| <div class='content'>Line of text</div> |
| <div class='content c2'>Line of text</div> |
| <div class='content' id='d2'>Line of text</div> |
| </div> |
| <div id='f3'> |
| <style scoped='true'> |
| div { |
| background-color: yellow; |
| } |
| .c3 { |
| background-color: orange; |
| } |
| #d3 { |
| background-color: red; |
| } |
| </style> |
| <div class='content'>Line of text</div> |
| <div class='content c3'>Line of text</div> |
| <div class='content' id='d3'>Line of text</div> |
| </div> |
| |
| <p>Partial overlap, @region more specific than <style scoped> (@region style has rules for class and id, scoped style has rule for <div>)</p> |
| <div class='container r1'></div> |
| <div class='container r1'></div> |
| <p>Partial overlap, <style scoped> more specific than @region (@region style has rule for <div>, scoped style has rules for class and id)</p> |
| <div class='container r2'></div> |
| <div class='container r2'></div> |
| <p>Overlap, @region and <style scoped> using the same selectors (both @region and scoped style have rules for <div>, class and id)</p> |
| <div class='container r3'></div> |
| <div class='container r3'></div> |
| </body> |
| </html> |