Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Try to pull in changes from google:master #1

Open
wants to merge 1,723 commits into
base: php-validator-generated
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1723 commits
Select commit Hold shift + click to select a range
9fbd67f
Lazily allocate observables (#6839)
chenshay Jan 5, 2017
185ca00
Fix an un-closed amp-ad tag in example. (#6889)
lannka Jan 5, 2017
4e365e5
Validator Rollup (#6898)
honeybadgerdontcare Jan 5, 2017
527f16e
Add amp.cloudflare.com to forms testcase. (#6899)
honeybadgerdontcare Jan 5, 2017
100a029
Pass down experiment toggles to 3p iframes. (#6801)
lannka Jan 5, 2017
fdf2220
Make the mask the child of the document body and not the fixed layer.…
camelburrito Jan 5, 2017
17cd61a
Remove whitelist for ooyala-player validator (#6904)
muxin Jan 5, 2017
0978711
Tweak regex to allow \n in variable values. (#6896)
avimehta Jan 6, 2017
c6a09a5
amp-youtube: Remove the layout wait, issue seems to have been fixed b…
aghassemi Jan 6, 2017
d6eb7ff
Allow amp-form to update amp-state (#6820)
Jan 6, 2017
514c255
Revert "Proxying the form to call the prototype methods/properties" (…
muxin Jan 6, 2017
e61445a
add integration test to 3p ad (#6789)
zhouyx Jan 6, 2017
494f6fb
Switched from vid to cid for adsense and doubleclick integrations (#6…
avimehta Jan 6, 2017
021c613
Update doubleclick.md to properly reflect the state of the "useSameDo…
mlb7687 Jan 6, 2017
d07856b
doc change on amp-accordion (#6448)
zhouyx Jan 6, 2017
2f6d82d
actually generate ampcontext-v0.js (#6919)
erwinmombay Jan 6, 2017
c7631f9
Merges isDevChannel() and isDevChannelVersionDoNotUse_() to isCanary(…
lannka Jan 7, 2017
06836b7
Use intermediary AST for Bind expression evaluation (#6840)
Jan 7, 2017
8033713
Add whatsapp to default config for amp-social-share and update pinter…
mkhatib Jan 7, 2017
33739b9
Fixed Carousel Arrow SVGs - Added IE11 Compatible Charset for SVGs (#…
torch2424 Jan 9, 2017
bcaa1ca
remove 2 vp length check (#6907)
zhouyx Jan 9, 2017
adb6015
Launch amp-playbuzz experiment (#6947)
Jan 9, 2017
5624059
Fix structured return from key signing in a number of negative cases …
Jan 9, 2017
f11a5da
Fixing broken carousel snap on master (#6949)
camelburrito Jan 9, 2017
98fdc2b
Default requireAmpResponseSourceOrigin to true. (#6744)
lannka Jan 9, 2017
5199aa0
Allow data-amp-replace on input[type=hidden]. (#6952)
honeybadgerdontcare Jan 10, 2017
379c8a3
amp-bind: Refactor attribute mutation flow (#6779)
Jan 10, 2017
a95aaf9
write out css files to build and dist folders (#6946)
erwinmombay Jan 10, 2017
f7f408e
Import Gulp webserver as a middleware into Karma test server (#6937)
lannka Jan 10, 2017
f627a36
Launch amp-selector (#6969)
camelburrito Jan 10, 2017
2a123e6
Scan used extension in HTML head, instead whole document. (#6954)
lannka Jan 10, 2017
1f620b6
Allow experiments being opted in at document level. (#6938)
lannka Jan 10, 2017
5443d59
Proxying the form to call the prototype methods/properties, incl Chro…
Jan 10, 2017
69c6baf
Added initial version of amp-anlaytics variable filters. (#6560)
avimehta Jan 10, 2017
daf326a
Bind validator (#6665)
Jan 11, 2017
1181681
Ensure that iframe is fully x-origin for 3p case (#6979)
Jan 11, 2017
2c6e6f7
Ad type adverticumv.2 (#6493)
Adverticum Jan 11, 2017
633d45b
Reverts #6952 but keep the removal of default-value (#6983)
honeybadgerdontcare Jan 11, 2017
9ee7c1f
amp-viewer-integration handshake updates (#6845)
chenshay Jan 11, 2017
155e23b
Introduces logic for A4A Multisize implementation. (#6677)
glevitzky Jan 11, 2017
83d40e0
Update link to Custom Elements doc to v1 version (#6975)
dandv Jan 11, 2017
fa63c19
Use dots for closure compiling tasks in travis to avoid timeout (#6980)
muxin Jan 12, 2017
0027e1d
Adding a4a support to TripleLift amp-ads (#6884)
szach Jan 12, 2017
ab78ba8
Allow redirection after submission through AMP-Redirect-To header (#6…
mkhatib Jan 12, 2017
eca0ca6
Add support for Bind's linked carousels use case (#6797)
Jan 12, 2017
73d66af
Add amp-bind support to amp-video (#6905)
Jan 12, 2017
ff76164
Assorted Bind validator fixes (#7005)
Jan 12, 2017
fa5c6cc
Let all async gulp tasks return Promise. (#6844)
lannka Jan 12, 2017
9e555b7
Expose move to slide method on slidescroll to enable flim-strip exper…
camelburrito Jan 12, 2017
ad75d41
cron job from @erwinmombay to update size.txt and size.csv (#6982)
donttrustthisbot Jan 12, 2017
663f1f4
update doc (#7016)
zhouyx Jan 12, 2017
04d1d8e
Pixel re-implemented to trigger immediately on visibility (#6988)
Jan 12, 2017
ed05a09
Add some A4A ad request parameters (#6643)
bobcassels Jan 12, 2017
4adf4df
Unlaunch ios-embed-wrapper for iOS8 to avoid scroll freezing issues (…
Jan 12, 2017
80ff445
Turned on experiment flag (#6774)
bradfrizzell Jan 12, 2017
f069143
dev().info()->dev().fine() (#7017)
chenshay Jan 12, 2017
f2bac16
viewer-integr.js -> amp-viewer-integration (#6989)
chenshay Jan 12, 2017
e56601a
handle unload (#7001)
chenshay Jan 12, 2017
c5d305c
Upgrade post-css and related packages to latest (#7020)
aghassemi Jan 12, 2017
a72a54f
skeleton for amp-tabs (#7003)
chenshay Jan 13, 2017
9b66415
Validator rollup (#7023)
Gregable Jan 13, 2017
f17c0f5
Laterpay validator config (#6974)
Jan 13, 2017
bb087e3
Avoid duplicating server-layout (#7021)
Jan 13, 2017
b0eaea8
adds support for Gemius analytics (#6558)
k-krygiel Jan 13, 2017
fd2cfc7
Use URL replacer from embed for pixel (#7029)
Jan 13, 2017
93b67b0
resizing of margins (#6824)
tlong2 Jan 13, 2017
c882ba1
Refactor observables in viewer-impl into a map object (#7004)
muxin Jan 13, 2017
17136cf
Moves closure sha384 into a new extension amp-crypto-polyfill for laz…
lannka Jan 13, 2017
8b12f9e
Delegate submit events until amp-form is loaded (#6929)
mkhatib Jan 13, 2017
af21b1b
Remove whitelist for lightbox scrollable validator (#7034)
muxin Jan 14, 2017
3209535
Add notes about requesting ads ATF and link to demo (#7037)
megankj Jan 14, 2017
01bb681
Update csa.md to remove non-required parameters (#6902)
mmcao Jan 14, 2017
5fddb61
Scroll the document when scrollTop message is sent from viewer (#6679)
muxin Jan 17, 2017
1972fac
Early implementation of amp-access-laterpay (#5920)
trodrigues Jan 17, 2017
9b2d835
Overflow element must have position:relative style (#7061)
Jan 17, 2017
ec96f9f
Temporary solution for most common form-proxy failures (#7065)
Jan 17, 2017
f77fe08
Add Carousel and Selector to Bind validator (#7067)
Jan 17, 2017
4c9cdcf
Update amp-selector.md (#7073)
camelburrito Jan 17, 2017
766b89c
Changing the <amp-auto-ads> config URL code for AdSense to use the pa…
tlong2 Jan 18, 2017
2a7cfaa
add a way to override hostname (#6972)
erwinmombay Jan 18, 2017
49f80f9
Reuse resource when reparented for some extensions (#7035)
Jan 18, 2017
9bbc9fb
cron job from @erwinmombay to update size.txt and size.csv (#7084)
donttrustthisbot Jan 18, 2017
eda679b
Fix incorrect documentation for extended templates (#7068)
tonyruscoe Jan 18, 2017
a456ff8
Fix accidental null of amp-image-lightbox keyboard listener (#7052)
jacobwgillespie Jan 18, 2017
51762e9
Form Proxy: Support null EventTarget class (#7077)
jridgewell Jan 18, 2017
5475006
Putting installFormProxy in a TryCatch for now (#7079)
aghassemi Jan 18, 2017
43c7963
Make zid optional (#7071)
jtsai783 Jan 18, 2017
bbe4f48
Append CSA container to 'c' container (#7083)
megankj Jan 18, 2017
330fdb2
Fix broken shields (#7051)
afischer Jan 18, 2017
bd9f04d
amp-lighbox: add docs for scrollable (#7087)
aghassemi Jan 18, 2017
fe7e0ae
Changed amp3pSentinel to sentinel with exp flag (#6922)
bradfrizzell Jan 18, 2017
8a02253
<amp-apester-media> out of experiment (#7055)
mrsufgi Jan 18, 2017
904490d
use switch statement in mergeShadowHead and ignore other link relatio…
Jan 18, 2017
390ee71
Update ads/README.md to mention the container div. (#7090)
lannka Jan 18, 2017
78de1c5
Use resource.layoutBox instead of change.boundingClientRect to calcu…
lannka Jan 18, 2017
c0a5834
Removes multi-size carveout from Fast Fetch. (#7092)
glevitzky Jan 18, 2017
984dd5f
Use local resources for integration tests (#7093)
aghassemi Jan 19, 2017
337bd04
update ampicon.png (#7097)
erwinmombay Jan 19, 2017
7b77dd9
Ramp up sentinel name change in canary config (#6991)
bradfrizzell Jan 19, 2017
8eb6f9a
removed trailling comma (#7108)
bradfrizzell Jan 19, 2017
3827c5f
Changed vid to cid. (#7095)
glevitzky Jan 19, 2017
d5ebb22
Add base implementation getHTML (#6818)
DiMurer Jan 19, 2017
d2029fd
Removed iframeContextInName flag for experiment (#7107)
bradfrizzell Jan 19, 2017
bb2768b
Use max version on-demand loaded scripts in tests (#7110)
aghassemi Jan 19, 2017
68e0349
Introduce field "runtime=inabox" in error reporting to differentiate …
lannka Jan 19, 2017
aa7ebcb
Bump version of error tracker for deployment (#7124)
cramforce Jan 20, 2017
e88a6e0
add OWNERS.yaml to examples (#7098)
erwinmombay Jan 20, 2017
1b2453c
Refector baseCid in viewer into cid-impl (#7111)
muxin Jan 20, 2017
3bdb2f7
Update where optout functionality can be used in amp-analytics. (#7134)
avimehta Jan 20, 2017
d17e7e2
Validator rollup (#7137)
honeybadgerdontcare Jan 20, 2017
e88bd6d
Fix amp-hulu test flaky time out (#7135)
muxin Jan 21, 2017
52c5f71
#7045 | Adding Acquia as vendor (#7103)
nickveenhof Jan 23, 2017
c195bdd
Better English, more consistent style (#7155)
dandv Jan 23, 2017
9a464b2
Add amp-bind experiment (#7157)
Jan 23, 2017
27d6886
Use proper application/json response header instead of arraybuffer. (…
mkhatib Jan 23, 2017
cbf5313
Fix incorrect nesting of doublequote and square bracket that was brea…
jonkeller Jan 23, 2017
e967073
Clarify what Vsync does (#7165)
dandv Jan 23, 2017
a77c434
Add an extra check for checkValidity on the element. (#7126)
mkhatib Jan 23, 2017
e9349d5
Move Cid service to doc-scope and fixes to elements to work in shadow…
mkhatib Jan 24, 2017
74d85d6
Limit form variable substitutions to canonical-origin actions (#7169)
mkhatib Jan 24, 2017
9ef0084
Fix mention of "third party components" section (#7164)
dandv Jan 24, 2017
97e17d6
Enable "chunked-amp" in canary (#7182)
Jan 24, 2017
1558a7f
Add code language for codeblocks so render correctly (#7180)
Jan 24, 2017
e29c339
Url link issue in documentation for analytics vendor Acquia (#7177)
nickveenhof Jan 24, 2017
324d352
Update ad loading UX. (#7167)
lannka Jan 24, 2017
e0c9c88
Shadow DOM v1 (#7059)
Jan 24, 2017
fa1bc77
Implementing a more comprehensive strategy for amp-auto-ads. (#7106)
tlong2 Jan 25, 2017
b3719cd
Revert "Use max version on-demand loaded scripts in tests (#7110)" (#…
aghassemi Jan 25, 2017
b831a02
Apply opacity to the loading line. (#7189)
lannka Jan 25, 2017
c2b175e
Turn on amp-ad-loading-ux on canary. (#7187)
lannka Jan 25, 2017
c74c423
Documentation about optout control (#7188)
Jan 25, 2017
0004fb7
Clean up unused variables in viewport (#7195)
muxin Jan 25, 2017
add2c44
Adds way for Fast Fetch to collapse ads with 204 response code. (#7131)
glevitzky Jan 25, 2017
ce82f49
Clarify that assertString/Number allow empty string and zero (#7202)
Jan 25, 2017
60a0a68
Launch amp-form-custom-validations experiment (#7185)
mkhatib Jan 25, 2017
6a547b9
cron job from @erwinmombay to update size.txt and size.csv (#7197)
donttrustthisbot Jan 25, 2017
1736865
Analytics root to separate top-level vs embed analytics for FIE (#7172)
Jan 25, 2017
96ad4af
Create a pull request template for the project. (#7193)
cramforce Jan 25, 2017
e9fd8e2
add yarn.lock file for deterministic builds (#7041)
erwinmombay Jan 25, 2017
02923dc
Fix typo in validator-amp-analytics.protoascii (#7211)
honeybadgerdontcare Jan 25, 2017
298920c
Cloudflare ad network example (#6882)
oliy Jan 26, 2017
e3ca900
Send link relations in documentLoaded message (#7142)
muxin Jan 26, 2017
eb1acc8
Fix broken shadow embed test (#7213)
mkhatib Jan 26, 2017
8be35f4
Element-level signals for lifecycle events (#7205)
Jan 26, 2017
0cb150d
AMP-ad supports Sklik.cz ad network (#7150)
cfmano Jan 26, 2017
1c6cbe1
margins on placements (#7153)
tlong2 Jan 26, 2017
4368b1e
Rename installCidServiceForDocForTesting (#7209)
mkhatib Jan 26, 2017
81f7af3
Revert "Fix build breakage" (#6568)
Jan 26, 2017
c6dfcf4
Add ValueCommerce support for amp-ad (#6962)
MichinaoShimizu Jan 27, 2017
e78d99d
Update docs for goToSlide (#7223)
ericlindley-g Jan 27, 2017
9acc6ad
Update csa.md (#7148)
mmcao Jan 27, 2017
63bc93a
fix [slide]=0 bug (#7229)
Jan 27, 2017
38afb0d
Support generic chunking and chunk Bind's DOM scan (#6967)
Jan 27, 2017
f33b581
Update amp-bind docs (#7216)
Jan 27, 2017
4ecfb21
Add URL rewriting and `srcset` support to amp-bind (#7206)
Jan 27, 2017
78dd260
Added documentation for A4A (#7233)
bradfrizzell Jan 27, 2017
4224565
More amp-bind examples in separate folder (#7127)
Jan 27, 2017
e81104a
Reduce URL entropy for preconnect polyfill. (#7227)
cramforce Jan 27, 2017
3b35ad5
Add link for analytics vendor - Yandex (#7232)
Jan 27, 2017
eda00e9
Fix typo (#7207)
dandv Jan 27, 2017
1fed17f
chore(package): update eslint to version 3.14.1 (#7204)
greenkeeperio-bot Jan 27, 2017
ecb6afd
chore(package): update karma-browserify to version 5.1.1 (#7200)
greenkeeperio-bot Jan 27, 2017
7eda4a8
chore(package): update watchify to version 3.9.0 (#7196)
greenkeeperio-bot Jan 27, 2017
d6de676
chore(package): update browserify to version 14.0.0 (#7191)
greenkeeperio-bot Jan 27, 2017
f6c0ed4
chore(package): update gulp-uglify to version 2.0.1 (#7183)
greenkeeperio-bot Jan 27, 2017
daf29d3
chore(package): update autoprefixer to version 6.7.0 (#7147)
greenkeeperio-bot Jan 27, 2017
87b2dc4
Extract signals into its own class (#7240)
Jan 30, 2017
487c9a8
Document that amp-form supports amp-selector (#7242)
dandv Jan 30, 2017
454bf58
amp-img: prpogate title (#7237)
aghassemi Jan 30, 2017
ca45634
Have option to check forbiddenTerms in test folders (#7234)
muxin Jan 30, 2017
5eb7fa9
Relap support for amp-ads (#7011)
advzr Jan 30, 2017
f0b87e6
add advance bidder support for openx amp ad (#7221)
rjvelicaria Jan 30, 2017
780e896
Fix regex so that `/ads.amp.max.html?type=taboola` would work for amp…
lannka Jan 31, 2017
bba72a8
amp-iframe guideline to prefer existing components (#7264)
ericlindley-g Jan 31, 2017
c5b2be2
Ensure SVG data URIs use "charset=utf-8" (#7263)
jridgewell Jan 31, 2017
25413ae
Ad type adverticum 3p script https/http support. (#7176)
Adverticum Jan 31, 2017
cd884cf
Exposing play, pause, mute, unmute actions and making integration tes…
aghassemi Jan 31, 2017
8120601
Page-level visibility time for embed performance reporting (#7241)
Jan 31, 2017
ae9813a
Validator rollup (#7271)
Gregable Jan 31, 2017
74cc272
Remove 'experimental' for custom validation as it's now launched (#7226)
Jan 31, 2017
81b8020
Fix bug when changing amp-carousel slides before layout (#7268)
Jan 31, 2017
883053b
Support <amp-social-share type="system"> (#6688)
ithinkihaveacat Jan 31, 2017
3cc3c6a
Wait for amp-selector to build before submitting (#7190)
mkhatib Jan 31, 2017
a24dbda
Implement mechanism for ensuring that all extensions share an AMP ver…
cramforce Jan 31, 2017
d3e96b8
Apply unpausable animation work-around to all of iOS not just Safari …
aghassemi Feb 1, 2017
c897b7c
Form Submit Accepts JSON Responses (#7139)
jridgewell Feb 1, 2017
1767444
Implement Google AdWords specific tracking pixels (#7273)
cramforce Feb 1, 2017
079deaa
cron job from @erwinmombay to update size.txt and size.csv (#7282)
donttrustthisbot Feb 1, 2017
bbe8b35
Created attributes.js (#7129)
bradfrizzell Feb 1, 2017
d2c1d39
Specify a z-index for autoplay animation (#7280)
aghassemi Feb 1, 2017
582d772
Rambler SSP ad network (#7179)
CrazySquirrel Feb 1, 2017
d9a1c7c
Make fetch "normal" (#7138)
jridgewell Feb 1, 2017
dca9e9a
Remove Safari 8 config (#7276)
aghassemi Feb 1, 2017
aa10e64
Update DEVELOPING.md (#7294)
adelinamart Feb 1, 2017
a7d39a7
Pass associated element directly to console (#7277)
Feb 1, 2017
2a791b5
Add Swoop amp-ad support (#7292)
mbell697 Feb 1, 2017
2edae9b
More liberal regex in form test (#7297)
mkhatib Feb 1, 2017
7845df7
Fix computation of blacklisted_cdata_regex as well as code which was …
Gregable Feb 2, 2017
57810d9
Add scopedQuerySelector helper (#7260)
jridgewell Feb 2, 2017
5b10381
Introduce an experiment to measure page jank via vsync. (#7293)
lannka Feb 2, 2017
9de3239
Using `playing` instead of `play` event (#7279)
aghassemi Feb 2, 2017
12c9c61
Render-start analytics event for documents and embeds (#7220)
Feb 2, 2017
d8c2c6a
Fix test (#7304)
aghassemi Feb 2, 2017
a9b4f0d
Fix bug in rendering caused by minification (#7308)
ixpaciga Feb 2, 2017
af90bed
Pass context down for a4a ad rendering to allow window.context to fun…
bradfrizzell Feb 2, 2017
1f6930c
Update documentation and examples for the amp-video script (#7235)
aghassemi Feb 2, 2017
df097a9
TreeWalker in Bind & better variable names (#7288)
Feb 2, 2017
5e5173b
Clean up `amp-selector` experiment (#7305)
camelburrito Feb 2, 2017
9b79e64
add fine logging to bind (#7314)
Feb 2, 2017
b8e8685
Update contributors. (#7313)
honeybadgerdontcare Feb 2, 2017
42c0d28
Add additional details for how community members can participate, inc…
mrjoro Feb 2, 2017
c7cb59f
Add support for "renderStart" and "noContentAvailable" for adup-tech …
SteffenAnders Feb 2, 2017
2ba97de
Factor out jank meter code into separate file (#7309)
lannka Feb 2, 2017
133cf10
Use Date.now() instead of performance.now(). The former is 10x faster…
lannka Feb 3, 2017
41302da
Revert "Using `playing` instead of `play` event" (#7321)
aghassemi Feb 3, 2017
c65e52c
Fix hardcoded 3p.ampproject.net in frame.html #7323 (#7324)
dknecht Feb 3, 2017
1f537db
Update forms docs to include submit action and inputs change event. (…
mkhatib Feb 3, 2017
89a7cd0
Update amp-analytics.js (#7318)
avimehta Feb 3, 2017
0a02a99
Improve reporting of amp-bind user errors (#7335)
Feb 3, 2017
b96e7da
trigger submit event in xhr action (#7278)
mkhatib Feb 4, 2017
52fddf4
Limit URL replacement to secure origins. (#7347)
cramforce Feb 4, 2017
434b503
Classify new domain scheme traffic as coming from CDN. (#7348)
cramforce Feb 5, 2017
3a797d7
Rename brainy (#7224)
Feb 6, 2017
8b22d50
Only build shadow and inabox binaries when flag is given. (#7346)
cramforce Feb 6, 2017
9605919
Throttle "Script error." reports. (#7371)
cramforce Feb 6, 2017
e63b410
Turn on ad loading ux on prod. (#7315)
lannka Feb 6, 2017
c0f6e75
Remove amp-video from list of built-ins (#7311)
Feb 6, 2017
7e15764
Directly report logged errors instead of relying on rethrowing (#7358)
cramforce Feb 6, 2017
cb74df7
Rename messaging request string in history (#7382)
muxin Feb 6, 2017
b9a0974
use source url instead of window.location (#7302)
jtsai783 Feb 6, 2017
ad9d07a
rename goToSlide event to slideChange (#7387)
Feb 7, 2017
211119b
Fix race condition within A4A verify (#6837)
keithwrightbos Feb 7, 2017
4d8f17b
Fix article-fixed-header example (#7356)
muxin Feb 7, 2017
fbc0bc2
Update CONTRIBUTING Weekly Status & Design Review sections with the l…
mrjoro Feb 7, 2017
26b636b
Docs add links for analytics vendors (#7375)
Feb 7, 2017
483e227
Fix Chunks in extensions (#7374)
Feb 7, 2017
a427135
Remove GPU rasterizaton reasoning for viewport (#7373)
Feb 7, 2017
6a97771
Directly report errors for browser events and timer. (#7363)
cramforce Feb 7, 2017
eeebd93
Launch make-body-relative (#7403)
Feb 7, 2017
76a39ec
bump amphtml-validator version (#7407)
sebastianbenz Feb 7, 2017
184c0c9
Fix history.pushState /undefined on Edge. (#7386)
mkhatib Feb 7, 2017
fa407ec
Revert "Turn on ad loading ux on prod. (#7315)" (#7410)
erwinmombay Feb 7, 2017
f1e09f0
Visibility-v2: use IntersectionObserverPolyfill (#7383)
lannka Feb 7, 2017
8a06609
Split up variable substitutions in forms for POST submits (#7408)
mkhatib Feb 7, 2017
8cefbe6
Cleanup amp-form-custom-validations experiment (#7405)
mkhatib Feb 7, 2017
deda591
Refactor spy/stub called expectations (#7412)
mkhatib Feb 8, 2017
47b8140
Document amp-selector's `select` event (#7411)
Feb 8, 2017
b9bf1f9
Fix visibility test failed on browsers without IntersectionObserver (…
lannka Feb 8, 2017
7ed7a89
Fix all errors that we throw during tests that throw no errors. (#7409)
cramforce Feb 8, 2017
bc0812e
Merge branch 'master' into php-validator-generated
dawehner Feb 8, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"es6.blockScoping",
"es6.classes",
"es6.constants",
"es6.destructuring",
"es6.tailCall",
"es6.modules",
"es6.parameters",
Expand Down
17 changes: 14 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"parser": "babel-eslint",
"rulePaths": ["build-system/eslint-rules/"],
"plugins": ["eslint-plugin-google-camelcase"],
"ecmaFeatures": {
"modules": true,
"arrowFunctions": true,
"blockBindings": true,
"forOf": false,
"destructuring": false,
"spread": false
"destructuring": true,
"spread": true
},
"env": {
"es6": true,
Expand All @@ -25,7 +27,9 @@
"assert": false,
"sinon": true,
"sandbox": true,
"context": false
"context": false,
"global": false,
"describes": true
},
"rules": {
"array-bracket-spacing": [2, "never"],
Expand All @@ -35,6 +39,7 @@
"computed-property-spacing": [2, "never"],
"curly": 2,
"dot-location": [2, "property"],
"enforce-private-props": 2,
"eol-last": 2,
"google-camelcase/google-camelcase": 2,
"indent": [2, 2, { "SwitchCase": 1 }],
Expand All @@ -45,11 +50,16 @@
"ignorePattern": ""
}],
"no-alert": 2,
"no-array-destructuring": 2,
"no-debugger": 2,
"no-div-regex": 2,
"no-dupe-keys": 2,
"no-es2015-number-props": 2,
"no-eval": 2,
"no-export-side-effect": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-for-of-statement": 2,
"no-implicit-coercion": [2, { "boolean": false }],
"no-implied-eval": 2,
"no-iterator": 2,
Expand All @@ -61,6 +71,7 @@
"no-self-compare": 2,
"no-sequences": 2,
"no-spaced-func": 2,
"no-spread": 2,
"no-throw-literal": 2,
"no-trailing-spaces": 2,
"no-unused-expressions": 0,
Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Please pick a meaningful title for your pull request using sentence case.

Do not overuse punctuation in the title like `(chore):`. If it is helpful feel free to start with a project name, though, like `ProjectX: Implement some feature`.

# Title instructions above.

Enter a succinct description of what is achieved by the PR. Ideally describe why the change is being made.

Bullet points like

- Implements aspect X
- Leaves out feature Y because of A
- Improves performance by B

really help with making this more readable.

Fixes/Implements/Related-to #1 (enter issue number, except in rare cases where none exists).
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ c
dist
dist.3p
dist.tools
examples.build
examples.min
node_modules
npm-debug.log
.idea
.tm_properties
.settings
.vscode
typings
typings.json
build-system/runner/TESTS-TestSuites.xml
/test/manual/amp-ad.adtech.html
29 changes: 9 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,14 @@ addons:
- protobuf-compiler
- python-protobuf
before_install:
- export CHROME_BIN=chromium-browser
- export CHROME_BIN=google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome*.deb
before_script:
- npm install -g gulp
- pip install --user protobuf
script:
- gulp lint
- gulp build --fortesting
- gulp check-types
- gulp dist --fortesting
- gulp presubmit
# dep-check needs to occur after build since we rely on build to generate
# the css files into js files.
- gulp dep-check
# Unit tests with Travis' default chromium
- gulp test --compiled --fortesting
# Integration tests with all saucelabs browsers
- gulp test --saucelabs --integration --compiled --fortesting
# All unit tests with an old chrome (best we can do right now to pass tests
# and not start relying on new features).
# Disabled because it regressed. Better to run the other saucelabs tests.
# - gulp test --saucelabs --oldchrome
- gulp validator
script: node build-system/pr-check.js
branches:
only:
- master
Expand All @@ -51,3 +35,8 @@ branches:
env:
global:
- NPM_CONFIG_PROGRESS="false"

cache:
yarn: true
directories:
- node_modules
107 changes: 71 additions & 36 deletions 3p/3p.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import {dev, user} from '../src/log';
import {isArray} from '../src/types';
import {map} from '../src/utils/object';
import {rethrowAsync} from '../src/log';


Expand All @@ -35,7 +36,7 @@ let ThirdPartyFunctionDef;
* @const {!Object<ThirdPartyFunctionDef>}
* @visibleForTesting
*/
export const registrations = {};
export const registrations = map();

/** @type {number} */
let syncScriptLoads = 0;
Expand All @@ -45,7 +46,7 @@ let syncScriptLoads = 0;
* @param {ThirdPartyFunctionDef} draw Function that draws the 3p integration.
*/
export function register(id, draw) {
dev.assert(!registrations[id], 'Double registration %s', id);
dev().assert(!registrations[id], 'Double registration %s', id);
registrations[id] = draw;
}

Expand All @@ -57,7 +58,7 @@ export function register(id, draw) {
*/
export function run(id, win, data) {
const fn = registrations[id];
user.assert(fn, 'Unknown 3p: ' + id);
user().assert(fn, 'Unknown 3p: ' + id);
fn(win, data);
}

Expand All @@ -83,12 +84,19 @@ export function writeScript(win, url, opt_cb) {
* Asynchronously load the given script URL.
* @param {!Window} win
* @param {string} url
* @param {function()} cb
* @param {function()=} opt_cb
* @param {function()=} opt_errorCb
*/
export function loadScript(win, url, cb) {
export function loadScript(win, url, opt_cb, opt_errorCb) {
/** @const {!Element} */
const s = win.document.createElement('script');
s.src = url;
s.onload = cb;
if (opt_cb) {
s.onload = opt_cb;
}
if (opt_errorCb) {
s.onerror = opt_errorCb;
}
win.document.body.appendChild(s);
}

Expand Down Expand Up @@ -151,23 +159,6 @@ export function validateSrcContains(string, src) {
}
}

/**
* Throws a non-interrupting exception if data contains a field not supported
* by this embed type.
* @param {!Object} data
* @param {!Array<string>} allowedFields
*/
export function checkData(data, allowedFields) {
// Throw in a timeout, because we do not want to interrupt execution,
// because that would make each removal an instant backward incompatible
// change.
try {
validateData(data, allowedFields);
} catch (e) {
rethrowAsync(e);
}
}

/**
* Utility function to perform a potentially asynchronous task
* exactly once for all frames of a given type and the provide the respective
Expand Down Expand Up @@ -209,15 +200,34 @@ export function computeInMasterFrame(global, taskId, work, cb) {
}

/**
* Throws an exception if data does not contains a mandatory field.
* Validates given data. Throws an exception if the data does not
* contains a mandatory field. If called with the optional param
* opt_optionalFields, it also validates that the data contains no fields other
* than mandatory and optional fields.
*
* Mandatory fields also accept a string Array as an item. All items in that
* array are considered as alternatives to each other. So the validation checks
* that the data contains exactly one of those alternatives.
*
* @param {!Object} data
* @param {!Array<string>} mandatoryFields
* @param {!Array<string|!Array<string>>} mandatoryFields
* @param {Array<string>=} opt_optionalFields
*/
export function validateDataExists(data, mandatoryFields) {
export function validateData(data, mandatoryFields, opt_optionalFields) {
let allowedFields = opt_optionalFields || [];
for (let i = 0; i < mandatoryFields.length; i++) {
const field = mandatoryFields[i];
user.assert(data[field],
'Missing attribute for %s: %s.', data.type, field);
if (Array.isArray(field)) {
validateExactlyOne(data, field);
allowedFields = allowedFields.concat(field);
} else {
user().assert(data[field],
'Missing attribute for %s: %s.', data.type, field);
allowedFields.push(field);
}
}
if (opt_optionalFields) {
validateAllowedFields(data, allowedFields);
}
}

Expand All @@ -227,7 +237,7 @@ export function validateDataExists(data, mandatoryFields) {
* @param {!Object} data
* @param {!Array<string>} alternativeFields
*/
export function validateExactlyOne(data, alternativeFields) {
function validateExactlyOne(data, alternativeFields) {
let countFileds = 0;

for (let i = 0; i < alternativeFields.length; i++) {
Expand All @@ -237,19 +247,19 @@ export function validateExactlyOne(data, alternativeFields) {
}
}

user.assert(countFileds === 1,
user().assert(countFileds === 1,
'%s must contain exactly one of attributes: %s.',
data.type,
alternativeFields.join(', '));
}

/**
* Throws an exception if data contains a field not supported
* Throws a non-interrupting exception if data contains a field not supported
* by this embed type.
* @param {!Object} data
* @param {!Array<string>} allowedFields
*/
export function validateData(data, allowedFields) {
function validateAllowedFields(data, allowedFields) {
const defaultAvailableFields = {
width: true,
height: true,
Expand All @@ -260,13 +270,38 @@ export function validateData(data, allowedFields) {
location: true,
mode: true,
consentNotificationId: true,
ampSlotIndex: true,
};

for (const field in data) {
if (!data.hasOwnProperty(field) ||
field in defaultAvailableFields) {
if (!data.hasOwnProperty(field) || field in defaultAvailableFields) {
continue;
}
user.assert(allowedFields.indexOf(field) != -1,
'Unknown attribute for %s: %s.', data.type, field);
if (allowedFields.indexOf(field) < 0) {
// Throw in a timeout, because we do not want to interrupt execution,
// because that would make each removal an instant backward incompatible
// change.
rethrowAsync(new Error(`Unknown attribute for ${data.type}: ${field}.`));
}
}
}

/** @private {!Object<string, boolean>} */
let experimentToggles = {};

/**
* Returns true if an experiment is enabled.
* @param {string} experimentId
* @return {boolean}
*/
export function isExperimentOn(experimentId) {
return !!experimentToggles[experimentId];
}

/**
* Set experiment toggles.
* @param {!Object<string, boolean>} toggles
*/
export function setExperimentToggles(toggles) {
experimentToggles = toggles;
}
5 changes: 2 additions & 3 deletions 3p/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Examples: Youtube, Vimeo videos; Tweets, Instagrams; comment systems; polls; qui
- If you can make it not-iframe-based that is much better. (See e.g. the pinterest embed). We will always ask to do this first. E.g. adding a CORS endpoint to your server might make this possible.
- Must play well within [AMP's sizing framework](https://github.com/ampproject/amphtml/blob/master/spec/amp-html-layout.md).
- All JS on container page must be open source and bundled with AMP.
- Direct iframe embeds not using our 3p iframe mechanism (used e.g. for ads) are preferred.
- JavaScript loaded into iframe should be reasonable with respect to functionality.
- Use the `sandbox` attribute on iframe if possible.
- Provide unit and integration tests.
Expand All @@ -30,7 +29,7 @@ Examples: Youtube, Vimeo videos; Tweets, Instagrams; comment systems; polls; qui
- We welcome pull requests by all ad networks for inclusion into AMP.
- All ads and all sub resources must be served from HTTPS.
- Must play well within [AMP's sizing framework](https://github.com/ampproject/amphtml/blob/master/spec/amp-html-layout.md).
- Direct iframe embeds not using our 3p iframe mechanism (used by most ads) are preferred.
- For display ads support, always implement amp-ad and instruct your client to use your amp-ad implementation instead of using amp-iframe. Althought amp-iframe will render the ad, ad clicks will break and viewability information is not available.
- Providing an optional image only zero-iframe embed is appreciated.
- Support viewability and other metrics/instrumentation as supplied by AMP (via postMessage API)
- Try to keep overall iframe count at one per ad. Explain why more are needed.
Expand Down Expand Up @@ -60,4 +59,4 @@ Review the [ads/README](../ads/README.md) for further details on ad integration.
- JavaScript can not be involved with the initiation of font loading.
- Font loading gets controlled (but not initiated) by [`<amp-font>`](https://github.com/ampproject/amphtml/issues/648).
- AMP by default does not allow inclusion of external stylesheets, but it is happy to whitelist URL prefixes of font providers for font inclusion via link tags. These link tags and their fonts must be served via HTTPS.
- If a font provider does referrer based "security" it needs to whitelist the AMP proxy origins before being included in the link tag whitelist. AMP proxy sends the appropriate referrer header such as "https://cdn.ampproject.org".
- If a font provider does referrer based "security" it needs to whitelist the AMP proxy origins before being included in the link tag whitelist. AMP proxy sends the appropriate referrer header such as "https://cdn.ampproject.org" and "https://amp.cloudflare.com".
Loading