Skip to content

Commit b71846b

Browse files
authored
Meta: add auto-deploy, and missing boilerplate
Closes WICG#36 by including that change.
1 parent 54b811f commit b71846b

13 files changed

+130
-1321
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_size = 2
8+
indent_style = space
9+
trim_trailing_whitespace = true
10+
11+
[spec.bs]
12+
indent_size = 4
13+
14+
[Makefile]
15+
indent_style = tab

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto
2+
*.bs diff=html linguist-language=HTML

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
spec.html
2+
out/

.pr-preview

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"src_file": "spec.bs",
3+
"type": "bikeshed"
4+
}

.travis.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: generic
2+
3+
script:
4+
- make ci
5+
6+
branches:
7+
only:
8+
- master
9+
10+
notifications:
11+
email:
12+
on_success: never
13+
on_failure: always
14+
15+
deploy:
16+
provider: pages
17+
local-dir: out
18+
committer-from-gh: true
19+
skip-cleanup: true
20+
keep-history: true
21+
github-token: $GH_TOKEN

CODE_OF_CONDUCT.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
All documentation, code, and communication under this repository are covered by the [W3C Code of Ethics and Professional Conduct](https://www.w3.org/Consortium/cepc/).

CONTRIBUTING.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Contribution Details
2+
3+
## Joining WICG
4+
5+
This repository is being used for work in the W3C [Web Platform Incubator Community Group](https://www.w3.org/community/wicg/) (WICG), governed by the [W3C Community License Agreement (CLA)](http://www.w3.org/community/about/agreements/cla/). To make substantive contributions, you must join the Community Group, thus signing the CLA.
6+
7+
## Editing the specification
8+
9+
Edits to the specification are done in the `spec.bs` file, which is then compiled with the [Bikeshed](https://tabatkins.github.io/bikeshed/) spec pre-processor.
10+
11+
To build the specification, you can use one of:
12+
13+
- `make local`: uses a locally-installed copy of Bikeshed
14+
- `make remote`: uses a Bikeshed web service, so you don't have to install anything locally
15+
16+
## Tests
17+
18+
Tests are maintained as part of the [web platform tests](https://github.com/web-platform-tests/wpt) project, under the [`lifecycle`](https://github.com/web-platform-tests/wpt/tree/master/lifecycle) directory.
19+
20+
## For maintainers: identifying contributors to a pull request
21+
22+
If the author is not the sole contributor to a pull request, please identify all contributors in the pull request comment.
23+
24+
To add a contributor (other than the author, which is automatic), mark them one per line as follows:
25+
26+
```
27+
+@github_username
28+
```
29+
30+
If you added a contributor by mistake, you can remove them in a comment with:
31+
32+
```
33+
-@github_username
34+
```
35+
36+
If the author is making a pull request on behalf of someone else but they had no part in designing the feature, you can remove them with the above syntax.

LICENSE.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
All Reports in this Repository are licensed by Contributors under the [W3C Software and Document License](http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document).
2+
3+
Contributions to Specifications are made under the [W3C CLA](https://www.w3.org/community/about/agreements/cla/).

Makefile

+28-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
1+
SHELL=/bin/bash
2+
13
local: spec.bs
2-
bikeshed spec spec.bs spec.html
4+
bikeshed --die-on=warning spec spec.bs spec.html
5+
6+
spec.html: spec.bs
7+
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
8+
--output spec.html \
9+
--write-out "%{http_code}" \
10+
--header "Accept: text/plain, text/html" \
11+
-F die-on=warning \
12+
13+
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
14+
echo ""; cat spec.html; echo ""; \
15+
rm -f spec.html; \
16+
exit 22 \
17+
);
18+
19+
remote: spec.html
20+
21+
ci: spec.bs
22+
mkdir -p out
23+
make remote
24+
mv spec.html out/index.html
25+
cp *.png out/
26+
echo '<!DOCTYPE html><meta charset="utf-8"><title>Redirecting</title><meta http-equiv="refresh" content="0; URL=./"><link rel="canonical" href="./">' > out/spec.html
327

4-
remote: spec.bs
5-
curl https://api.csswg.org/bikeshed/ -f -F [email protected] > spec.html
28+
clean:
29+
rm spec.html
30+
rm -rf out

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Lifecycle API for Web Pages
2-
Link to spec: https://wicg.github.io/page-lifecycle/spec.html
2+
Link to spec: https://wicg.github.io/page-lifecycle/
33

44
## Motivation
55
For detailed motivation see [this doc](https://docs.google.com/document/d/1UuS6ff4Fd4igZgL50LDS8MeROVrOfkN13RbiP2nTT9I/edit#heading=h.ejq0luje6eyb).
@@ -61,7 +61,7 @@ It is not possible to have a guaranteed callback execute in most of these scenar
6161
We following changes are included in the MVP:
6262

6363
* `onfreeze` is fired to signal transition to FROZEN.
64-
* `onresume` is fired to signal transition out of FROZEN. This will be used to undo what was done in `onfreeze` above.
64+
* `onresume` is fired to signal transition out of FROZEN. This will be used to undo what was done in `onfreeze` above.
6565
* On DISCARDED -> ACTIVE, an attribute called `wasDiscarded` is added to the Document. This will be used to restore view state , when the user revisits a discarded tab.
6666
* `onfreeze` is also fired before transition to BFCACHE (before `pagehide` is fired) and `onresume` is also fired on transition out of BFCACHE (after `pageshow` is fired).
6767

@@ -81,7 +81,7 @@ The callbacks are necessary for several reasons:
8181
* Platform predictability and transparency in the face of freezing & discarding interventions becoming the norm. Specifically helping:
8282
* Analytics
8383
* Testing story
84-
84+
8585
For details see [this section of detailed doc](https://docs.google.com/document/d/1UuS6ff4Fd4igZgL50LDS8MeROVrOfkN13RbiP2nTT9I/edit#heading=h.s64wegvpugn9).
8686

8787
### API
@@ -129,15 +129,15 @@ if (document.wasDiscarded) {
129129
#### Potential future addition
130130
In the future, if frame-level freezing (i.e. freeze specific frames within a page) is pursued, then the API could be enhanced to indicate which frame tree is frozen.
131131
```
132-
// Indicate what is frozen exactly:
132+
// Indicate what is frozen exactly:
133133
// a. partial frame tree starting with current frame
134134
// b. partial frame tree starting with an ancestor frame
135135
// c. entire page in background
136136
// d. ...
137137
enum FrameLevel { ... };
138138
139139
interface FreezeEvent {
140-
readonly attribute FrameLevel frameLevel;
140+
readonly attribute FrameLevel frameLevel;
141141
}
142142
```
143143

spec.bs

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<pre class='metadata'>
22
Title: Page Lifecycle
3-
Group: webperf
3+
Group: WICG
4+
Status: CG-DRAFT
45
Shortname: page-lifecycle
56
Level: 1
6-
ED:
7-
TR:
8-
Status: ED
7+
URL: https://wicg.github.io/page-lifecycle/
98
Editor: Shubhie Panicker, Google https://google.com, [email protected]
109
Editor: Domenic Denicola, Google https://google.com, [email protected]
1110
Repository: wicg/page-lifecycle
@@ -265,8 +264,8 @@ Specific examples:
265264

266265
NOTE: background tabs that are actively doing work on behalf of the user (eg. playing audio) are generally not [=/frozen=] or [=/discarded=].
267266

268-
NOTE: For a detailed list of heuristics & exclusions used by Chrome, see <a href=https://docs.google.com/document/d/1QJpuBTdllLVflMJSov0tlFX3e3yfSfd_-al2IBavbQM/edit>this doc</a>.
269-
267+
NOTE: For a detailed list of heuristics & exclusions used by Chrome, see <a href=https://docs.google.com/document/d/1QJpuBTdllLVflMJSov0tlFX3e3yfSfd_-al2IBavbQM/edit>this doc</a>.
268+
270269
The UA will typically execute [=change the frozenness of a top-level document=] with false when the user revisits that browsing context. In addition, the UA may choose to periodically execute [=change the frozenness of a top-level document=] with false in the background, if plentiful resources are available.
271270

272271
<h4 id="changing-frozenness">Changing the frozenness of documents</h4>
@@ -332,7 +331,7 @@ Browsing contexts -- that are in the background and have their documents in <a h
332331

333332
NOTE: background tabs that are actively doing work on behalf of the user (eg. playing audio) are generally not [=/discarded=].
334333

335-
NOTE: For a detailed list of heuristics & exclusions used by Chrome, see <a href=https://docs.google.com/document/d/1QJpuBTdllLVflMJSov0tlFX3e3yfSfd_-al2IBavbQM/edit>this doc</a>.
334+
NOTE: For a detailed list of heuristics & exclusions used by Chrome, see <a href=https://docs.google.com/document/d/1QJpuBTdllLVflMJSov0tlFX3e3yfSfd_-al2IBavbQM/edit>this doc</a>.
336335

337336
When a [=top-level browsing context=] (tab in the browser) is [=/discarded=] due to resource pressure (or unexpected events eg. process crash), and later the user revisits the tab in the browser, then the {{Document}}'s [=Document/discarded=] boolean will be true due to [[#html-initialize-doc]].
338337

0 commit comments

Comments
 (0)