Add a selection and outline to flights-app.

This is just to get basic paint coverage of selections
and outlines on positioned elements.

TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/886683002
This commit is contained in:
Ojan Vafai 2015-01-28 21:48:28 -08:00
parent fa70bea051
commit 9ce3ec9139
4 changed files with 26 additions and 1 deletions

View File

@ -22,6 +22,11 @@
</template>
<script>
module.exports = class extends SkyElement {
attached() {
var sel = window.getSelection();
var input = this.shadowRoot.querySelector('t');
sel.selectAllChildren(input);
}
}.register();
</script>
</sky-element>

View File

@ -23,6 +23,16 @@
flex-shrink: 0;
margin-right: 6px;
}
.close-box {
position: absolute;
top: 3px;
right: 3px;
width: 1em;
overflow: hidden;
text-align: center;
outline: 1px solid #AEA477;
}
</style>
<div class="header">
<content select=".toast-icon" />
@ -30,6 +40,9 @@
<div class="content">
<content select=".toast-content" />
</div>
<div class="close-box">
X
</div>
</template>
<script>
module.exports = class extends SkyElement {

View File

@ -159,4 +159,11 @@ layer at (609,509) size 159x59 clip at (610,510) size 157x57
RenderParagraph (anonymous) at (0,30) size 106.69x15
RenderText {#text} at (0,0) size 107x15
text run at (0,0) width 107: "cheaper tomorrow."
layer at (751,513) size 13x15
RenderBlock (positioned) {div} at (141.89,4) size 12.80x15
RenderParagraph (anonymous) at (0,0) size 12.80x15
RenderText {#text} at (2,0) size 9x15
text run at (2,0) width 9: "X"
selection start: position 0 of child 0 {#text} of child 0 {t} of child 2 {span} of {#document-fragment} of child 0 {app-search-input} of child 2 {app-toolbar} of {#document-fragment} of child 3 {flights-app} of child 0 {sky} of document
selection end: position 28 of child 0 {#text} of child 0 {t} of child 2 {span} of {#document-fragment} of child 0 {app-search-input} of child 2 {app-toolbar} of {#document-fragment} of child 3 {flights-app} of child 0 {sky} of document

View File

@ -1,7 +1,7 @@
<sky>
<import src="../resources/run-after-display.sky" as="runAfterDisplay" />
<img src="http://storage.googleapis.com/mojo/sky-pngs/fb6e2e548b500925439506ea4990bb5951ff0127" />
<img src="http://storage.googleapis.com/mojo/sky-pngs/5eb363566d6dbf6a3afdd9a0edd9f90a95f41582" />
<script>
window.addEventListener('load', function() {