- refuse cases for all eight probe payloads (noscript href and handler, svg style, title and textarea, noembed, xmp, conditional comment) - send fallback and editor refusal for the three that survive rendering - escaped_send subtests check svg title/textarea sends with an x/net/html parser oracle, scripting on and off - accept cases for conditional comments, quoted CSS, a safe noscript link and a literal comment opener in an attribute
366 lines
19 KiB
Go
366 lines
19 KiB
Go
package postcard
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"strings"
|
|
"testing"
|
|
|
|
xhtml "golang.org/x/net/html"
|
|
)
|
|
|
|
// schemeFiller surrounds a case's markup, so a snippet that points at the
|
|
// offending markup is told apart from one that starts the document.
|
|
var schemeFiller = strings.Repeat("plain words here ", 6)
|
|
|
|
// TestURLSchemeCheck covers the anchored, decoded URL-scheme check of
|
|
// rendered HTML (WR-05): prose and URLs that merely contain a scheme word
|
|
// pass; every URL-bearing attribute, CSS, meta refresh and every
|
|
// character-reference or whitespace-split spelling of a script or data URL
|
|
// is refused, on a send with inlining on and off and in the editor. A
|
|
// raw-text end tag or a comment's end inside a quoted attribute does not hide
|
|
// the rest of the tag (CR-02 residual).
|
|
func TestURLSchemeCheck(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
accepts := []struct{ name, html string }{
|
|
{"prose_metadata", `<p>See the metadata: field</p>`},
|
|
{"prose_big_data", `<p>Big Data: Summit</p>`},
|
|
{"img_alt", `<img alt="Data: Summit" src="https://cdn.example.com/a.png">`},
|
|
{"title_text", `<td title="javascript: tips">Tips</td>`},
|
|
{"scheme_in_query", `<a href="https://example.com/?q=javascript:x">x</a>`},
|
|
// Escaped markup in a raw-text element is text to every reader.
|
|
{"textarea_escaped_link", `<textarea><a href="javascript:x"></textarea>`},
|
|
{"title_escaped_link", `<svg><title><a href="javascript:x"></title></svg>`},
|
|
{"noscript_safe_link", `<noscript><a href="https://example.com/">Open</a></noscript>`},
|
|
// Text shaped like an event handler is text (WR-02).
|
|
{"prose_handler_shaped", `<p>Ada, buy one = get one free, online = yes</p>`},
|
|
{"footer_handler_shaped_name", `<p>© 2026 Online=Shop</p>`},
|
|
{"title_escaped_handler", `<svg><title><img onerror=x></title></svg>`},
|
|
{"outlook_conditional_vml", `<!--[if mso]><v:roundrect href="https://example.com/" style="height:40px"><w:anchorlock/></v:roundrect><![endif]-->`},
|
|
// The tag reading, where quoting decides where a tag ends, refuses
|
|
// nothing mail uses (CR-02 residual).
|
|
{"conditional_comment_quoted_attrs", `<!--[if mso]><table role="presentation" width="600"><tr><td style="padding:0"><![endif]-->`},
|
|
{"conditional_comment_not_mso_safe_link", `<!--[if !mso]><!--><a href="https://example.com/">x</a><!--<![endif]-->`},
|
|
{"style_css_quoted_strings", `<style>td[title="a > b"] { font-family: "Helvetica Neue", Arial; }</style>`},
|
|
{"title_escaped_end_in_attr", `<svg><title><a title="</title>" href="javascript:x"></title></svg>`},
|
|
{"noscript_safe_link_end_in_attr", `<noscript><a title="</noscript>" href="https://example.com/">Open</a></noscript>`},
|
|
// Only the "<" of a comment opener is blanked, so a literal "<!--"
|
|
// in an attribute value does not become a scheme prefix.
|
|
{"href_literal_comment_opener", `<a href="<!--javascript:x">x</a>`},
|
|
}
|
|
for _, tc := range accepts {
|
|
t.Run("accept/"+tc.name, func(t *testing.T) {
|
|
t.Parallel()
|
|
if err := validateHTML("<div>" + schemeFiller + tc.html + schemeFiller + "</div>"); err != nil {
|
|
t.Errorf("validateHTML(%s) = %v, want nil", tc.html, err)
|
|
}
|
|
})
|
|
}
|
|
|
|
const schemeMsg = "dangerous URL scheme"
|
|
refuses := []struct {
|
|
name, html string
|
|
// marker is a raw text of the offending markup the snippet holds.
|
|
marker string
|
|
msg string
|
|
}{
|
|
{"href_javascript", `<a href="javascript:alert(1)">x</a>`, `href="javascript:alert(1)"`, schemeMsg},
|
|
{"href_space_mixed_case", `<a href=" JavaScript:alert(1)">x</a>`, `JavaScript:alert(1)`, schemeMsg},
|
|
{"src_data", `<img src="data:image/png;base64,AAAA">`, `data:image/png`, schemeMsg},
|
|
{"href_vbscript", `<a href="vbscript:msgbox(1)">x</a>`, `vbscript:msgbox(1)`, schemeMsg},
|
|
{"form_action", `<form action="javascript:x"></form>`, `action="javascript:x"`, schemeMsg},
|
|
{"button_formaction", `<button formaction="javascript:x">Go</button>`, `formaction="javascript:x"`, schemeMsg},
|
|
{"table_background", `<table background="javascript:x"><tr><td>x</td></tr></table>`, `background="javascript:x"`, schemeMsg},
|
|
{"video_poster", `<video poster="javascript:x"></video>`, `poster="javascript:x"`, schemeMsg},
|
|
{"svg_xlink_href", `<svg><a xlink:href="javascript:x"><text>x</text></a></svg>`, `xlink:href="javascript:x"`, schemeMsg},
|
|
{"img_srcset", `<img src="a.png" srcset="a.png 1x, javascript:x 2x">`, `javascript:x 2x`, schemeMsg},
|
|
{"style_url", `<div style="background:url(javascript:x)">x</div>`, `url(javascript:x)`, schemeMsg},
|
|
{"style_url_quoted_entity", `<div style="background:url("javascript:x")">x</div>`, `url("javascript:x")`, schemeMsg},
|
|
{"style_element_data", `<style>td { background: url(data:image/png;base64,AA); }</style>`, `url(data:image/png;base64,AA)`, schemeMsg},
|
|
{"meta_refresh", `<meta http-equiv="refresh" content="0;url=javascript:x">`, `url=javascript:x`, schemeMsg},
|
|
{"entity_decimal_colon", `<a href="javascript:alert(1)">x</a>`, `javascript:alert(1)`, schemeMsg},
|
|
{"entity_hex_colon", `<a href="javascript:alert(1)">x</a>`, `javascript:alert(1)`, schemeMsg},
|
|
{"entity_named_colon", `<a href="javascript:alert(1)">x</a>`, `javascript:alert(1)`, schemeMsg},
|
|
{"entity_first_letter", `<a href="javascript:alert(1)">x</a>`, `javascript:alert(1)`, schemeMsg},
|
|
{"tab_split", `<a href="java	script:alert(1)">x</a>`, `java	script:alert(1)`, schemeMsg},
|
|
{"newline_split", `<a href="java
script:alert(1)">x</a>`, `java
script:alert(1)`, schemeMsg},
|
|
{"handler_with_space", `<p class="x" onclick="x()">x</p>`, `onclick="x()"`, "event handlers"},
|
|
{"handler_without_space", `<img src="x.png"onerror="alert(1)">`, `onerror="alert(1)"`, "event handlers"},
|
|
// Raw-text element content that a mail client parses as markup
|
|
// (scripting off, foreign content in svg) (CR-02).
|
|
{"noscript_href", `<noscript><a href="javascript:alert(1)">x</a></noscript>`, `href="javascript:alert(1)"`, schemeMsg},
|
|
{"noscript_handler", `<noscript><img src="x"/onerror=alert(1)></noscript>`, `onerror=alert(1)`, "event handlers"},
|
|
{"svg_title_href", `<svg><title><a href="javascript:alert(1)">x</a></title></svg>`, `href="javascript:alert(1)"`, schemeMsg},
|
|
{"svg_textarea_href", `<svg><textarea><a href="javascript:alert(1)">x</a></textarea></svg>`, `href="javascript:alert(1)"`, schemeMsg},
|
|
{"svg_style_entity", `<svg><style><a href="javascript:alert(1)">x</a></style></svg>`, `javascript:alert(1)`, schemeMsg},
|
|
{"xmp_href", `<xmp><a href="javascript:alert(1)">x</a></xmp>`, `href="javascript:alert(1)"`, schemeMsg},
|
|
{"self_closing_style", `<style/><a href="javascript:alert(1)">x</a>`, `javascript:alert(1)`, schemeMsg},
|
|
{"conditional_comment_handler", `<!--[if mso]><img src="x.png" onerror="alert(1)"><![endif]-->`, `onerror="alert(1)"`, "event handlers"},
|
|
// An end tag inside a quoted attribute ends the raw-text element for
|
|
// the tokenizer but not for a conforming parser, which keeps the
|
|
// rest of the tag together (CR-02 residual).
|
|
{"svg_style_end_in_attr", `<svg><style><a title="</style>" href="javascript:alert(1)">x</a></style></svg>`, `href="javascript:alert(1)"`, schemeMsg},
|
|
{"noscript_href_end_in_attr", `<noscript><a title="</noscript>" href="javascript:alert(1)">x</a></noscript>`, `href="javascript:alert(1)"`, schemeMsg},
|
|
{"noscript_handler_end_in_attr", `<noscript><img title="</noscript>" src=x onerror=alert(1)></noscript>`, `onerror=alert(1)`, "event handlers"},
|
|
{"svg_title_end_in_attr", `<svg><title><a title="</title>" href="javascript:alert(1)">x</a></title></svg>`, `href="javascript:alert(1)"`, schemeMsg},
|
|
{"svg_textarea_end_in_attr", `<svg><textarea><a title="</textarea>" href="javascript:alert(1)">x</a></textarea></svg>`, `href="javascript:alert(1)"`, schemeMsg},
|
|
{"noembed_end_in_attr", `<noembed><a title="</noembed>" href="javascript:alert(1)">x</a></noembed>`, `href="javascript:alert(1)"`, schemeMsg},
|
|
{"xmp_end_in_attr", `<xmp><a title="</xmp>" href="javascript:alert(1)">x</a></xmp>`, `href="javascript:alert(1)"`, schemeMsg},
|
|
{"conditional_comment_end_in_attr", `<!--[if mso]><a title="-->" href="javascript:alert(1)">x</a><![endif]-->`, `href="javascript:alert(1)"`, schemeMsg},
|
|
// Whitespace-split schemes in list, meta, CSS and comment values
|
|
// (WR-01).
|
|
{"values_tab_split", `<svg><a><animate attributeName="href" values="java	script:alert(1)"/><text>x</text></a></svg>`, `values="java	script:alert(1)"`, schemeMsg},
|
|
{"meta_refresh_tab_split", `<meta http-equiv="refresh" content="0;url=java	script:alert(1)">`, `url=java	script:alert(1)`, schemeMsg},
|
|
{"srcset_newline_split", `<img src="a.png" srcset="a.png 1x, java script:x 2x">`, `java script:x 2x`, schemeMsg},
|
|
{"style_tab_split", `<div style="background:url(java	script:x)">x</div>`, `url(java	script:x)`, schemeMsg},
|
|
{"style_element_space_split", "<style>td { background: url(java\tscript:x); }</style>", "url(java script:x)", schemeMsg},
|
|
{"nested_too_deep", strings.Repeat("<noscript>", maxMarkupDepth+2) + "x", "<noscript>", "too deeply"},
|
|
}
|
|
for _, tc := range refuses {
|
|
t.Run("refuse/"+tc.name, func(t *testing.T) {
|
|
t.Parallel()
|
|
err := validateHTML("<div>" + schemeFiller + tc.html + schemeFiller + "</div>")
|
|
var ue *unsafeError
|
|
if !errors.As(err, &ue) {
|
|
t.Fatalf("validateHTML(%s) = %v, want an unsafe error", tc.html, err)
|
|
}
|
|
if !strings.Contains(ue.Error(), tc.msg) {
|
|
t.Errorf("error = %q, want %q", ue.Error(), tc.msg)
|
|
}
|
|
if !strings.Contains(ue.snippet, tc.marker) {
|
|
t.Errorf("snippet = %q, want it to point at %q", ue.snippet, tc.marker)
|
|
}
|
|
if strings.HasPrefix(ue.snippet, "<div>") {
|
|
t.Errorf("snippet = %q starts the document, not the offending markup", ue.snippet)
|
|
}
|
|
})
|
|
}
|
|
|
|
// An entity-encoded script link in a layout override's HTML makes the
|
|
// send fall back to the file version, whether or not the layout opts
|
|
// out of inlining; the encoded link never reaches the driver.
|
|
const encodedLink = `<a href="javascript:alert(1)">x</a>`
|
|
// The same holds for an unencoded link hidden in a raw-text element that
|
|
// html/template leaves as written (CR-02; it escapes title and textarea
|
|
// text itself).
|
|
links := []struct{ name, link string }{
|
|
{"encoded", encodedLink},
|
|
{"noscript", `<noscript><a href="javascript:alert(1)">x</a></noscript>`},
|
|
{"xmp", `<xmp><a href="javascript:alert(1)">x</a></xmp>`},
|
|
// An end tag inside a quoted attribute does not hide the rest of the
|
|
// tag (CR-02 residual). html/template escapes literal title and
|
|
// textarea text, so the svg title and textarea variants are sent as
|
|
// escaped text and checked by escaped_send below, not as fallbacks.
|
|
{"svg_style_end_in_attr", `<svg><style><a title="</style>" href="javascript:alert(1)">x</a></style></svg>`},
|
|
{"noscript_href_end_in_attr", `<noscript><a title="</noscript>" href="javascript:alert(1)">x</a></noscript>`},
|
|
{"noscript_handler_end_in_attr", `<noscript><img title="</noscript>" src=x onerror=alert(1)></noscript>`},
|
|
}
|
|
file := fileWelcome(t)
|
|
if strings.Contains(file.HTML, "javascript") {
|
|
t.Fatalf("the file version holds a script link:\n%s", file.HTML)
|
|
}
|
|
plugin := acmeBlog{}
|
|
cat := NewCatalog()
|
|
if err := cat.Register(plugin.ID(), plugin.MailTemplatesFS(), plugin.MailTemplates(), plugin.MailLayouts()); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
for _, l := range links {
|
|
for _, optOut := range []bool{false, true} {
|
|
name := "send/" + l.name + "/inline"
|
|
if optOut {
|
|
name = "send/" + l.name + "/opt_out"
|
|
}
|
|
t.Run(name, func(t *testing.T) {
|
|
t.Parallel()
|
|
assertFileFallback(t, cat, file, Options{Overrides: fakeOverrides{ov: Overrides{
|
|
Template: &TemplateOverride{Subject: "Hello {{ .name }}", Body: "Hi **{{ .name }}**.", Layout: "encoded"},
|
|
Layouts: map[string]LayoutOverride{"encoded": {
|
|
HTML: `<html><head><style>{{ .css }}</style></head><body><div>{{ .Content }}` + l.link + `</div></body></html>`,
|
|
Text: "{{ .Content }}",
|
|
CSS: "p { color: #123456; }",
|
|
DisableAutoInlineCSS: optOut,
|
|
}},
|
|
}}}, true)
|
|
})
|
|
}
|
|
}
|
|
|
|
// The svg title and textarea variants are escaped by html/template: the
|
|
// override is sent, and a conforming parser, with scripting on and off,
|
|
// builds no element with a handler or a script or data URL from it.
|
|
escaped := []struct{ name, link string }{
|
|
{"svg_title_end_in_attr", `<svg><title><a title="</title>" href="javascript:alert(1)">x</a></title></svg>`},
|
|
{"svg_textarea_end_in_attr", `<svg><textarea><a title="</textarea>" href="javascript:alert(1)">x</a></textarea></svg>`},
|
|
}
|
|
for _, l := range escaped {
|
|
for _, optOut := range []bool{false, true} {
|
|
name := "escaped_send/" + l.name + "/inline"
|
|
if optOut {
|
|
name = "escaped_send/" + l.name + "/opt_out"
|
|
}
|
|
t.Run(name, func(t *testing.T) {
|
|
t.Parallel()
|
|
drv := NewMemoryDriver()
|
|
m := NewMailer(cat, drv, Options{Overrides: fakeOverrides{ov: Overrides{
|
|
Template: &TemplateOverride{Subject: "Hello {{ .name }}", Body: "Hi **{{ .name }}**.", Layout: "encoded"},
|
|
Layouts: map[string]LayoutOverride{"encoded": {
|
|
HTML: `<html><head><style>{{ .css }}</style></head><body><div>{{ .Content }}` + l.link + `</div></body></html>`,
|
|
Text: "{{ .Content }}",
|
|
CSS: "p { color: #123456; }",
|
|
DisableAutoInlineCSS: optOut,
|
|
}},
|
|
}}})
|
|
sendWelcome(t, m, "")
|
|
got := lastMessage(t, drv)
|
|
if got.HTML == file.HTML {
|
|
t.Fatalf("the override was refused; the file version was sent")
|
|
}
|
|
if !strings.Contains(got.HTML, "<a title=") {
|
|
t.Errorf("the link was not sent as escaped text:\n%s", got.HTML)
|
|
}
|
|
for _, scripting := range []bool{true, false} {
|
|
doc, err := xhtml.ParseWithOptions(strings.NewReader(got.HTML), xhtml.ParseOptionEnableScripting(scripting))
|
|
if err != nil {
|
|
t.Fatalf("parse (scripting %v): %v", scripting, err)
|
|
}
|
|
if live := liveUnsafeElements(doc); len(live) > 0 {
|
|
t.Errorf("scripting %v: live unsafe attributes %v in:\n%s", scripting, live, got.HTML)
|
|
}
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
// The editor refuses the same layout draft on content_html, and a
|
|
// layout's CSS with a script URL on content_css; prose in a template
|
|
// body validates.
|
|
for _, optOut := range []bool{false, true} {
|
|
name := "editor/inline"
|
|
if optOut {
|
|
name = "editor/opt_out"
|
|
}
|
|
t.Run(name, func(t *testing.T) {
|
|
t.Parallel()
|
|
ctx := context.Background()
|
|
ed, _ := newEditor(t, nil)
|
|
layout := Draft{Kind: KindLayout, Name: defaultLayoutName, HTML: `<div>{{ .Content }}` + encodedLink + `</div>`, Text: "{{ .Content }}", DisableAutoInlineCSS: optOut}
|
|
de := ed.Validate(ctx, layout)
|
|
if de == nil || de.Field != fieldContentHTML || de.Rule != ruleUnsafe {
|
|
t.Fatalf("encoded link in a layout draft: %+v, want content_html/unsafe", de)
|
|
}
|
|
if !strings.Contains(de.Message, "javascript:alert(1)") {
|
|
t.Errorf("message = %q, want the encoded href", de.Message)
|
|
}
|
|
for _, l := range links[1:] {
|
|
hidden := Draft{Kind: KindLayout, Name: defaultLayoutName, HTML: `<div>{{ .Content }}` + l.link + `</div>`, Text: "{{ .Content }}", DisableAutoInlineCSS: optOut}
|
|
if de := ed.Validate(ctx, hidden); de == nil || de.Field != fieldContentHTML || de.Rule != ruleUnsafe {
|
|
t.Errorf("%s link in a layout draft: %+v, want content_html/unsafe", l.name, de)
|
|
}
|
|
}
|
|
|
|
def, ok := NewCatalog().Layout(defaultLayoutName)
|
|
if !ok {
|
|
t.Fatal("no built-in default layout")
|
|
}
|
|
css := Draft{Kind: KindLayout, Name: defaultLayoutName, HTML: def.HTML, Text: def.Text, CSS: "td { background: url(javascript:x); }", DisableAutoInlineCSS: optOut}
|
|
de = ed.Validate(ctx, css)
|
|
if de == nil || de.Field != fieldContentCSS || de.Rule != ruleUnsafe {
|
|
t.Fatalf("script URL in a layout's CSS: %+v, want content_css/unsafe", de)
|
|
}
|
|
|
|
tmpl := Draft{Kind: KindTemplate, Name: editorWelcome, Subject: "Hi {{ .Name }}", Body: "See the metadata: field.", Layout: defaultLayoutName}
|
|
if de := ed.Validate(ctx, tmpl); de != nil {
|
|
t.Errorf("a prose body was refused: %+v", de)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
// liveUnsafeElements lists, as "element key=value", every attribute of an
|
|
// element in the parsed tree n that is an event handler or a single-URL
|
|
// attribute with a script or data URL, with the namespace prefix
|
|
// unsafeMarkup builds.
|
|
func liveUnsafeElements(n *xhtml.Node) []string {
|
|
var live []string
|
|
if n.Type == xhtml.ElementNode {
|
|
for _, a := range n.Attr {
|
|
key := a.Key
|
|
if a.Namespace != "" {
|
|
key = a.Namespace + ":" + a.Key
|
|
}
|
|
if strings.HasPrefix(key, "on") || urlAttributes[key] && hasDangerousScheme(a.Val) {
|
|
live = append(live, n.Data+" "+key+"="+a.Val)
|
|
}
|
|
}
|
|
}
|
|
for c := n.FirstChild; c != nil; c = c.NextSibling {
|
|
live = append(live, liveUnsafeElements(c)...)
|
|
}
|
|
return live
|
|
}
|
|
|
|
// TestInlineUnsafeOutput covers an inlined result that fails the safety
|
|
// check (WR-05): the send succeeds with the checked, un-inlined HTML and its
|
|
// style block, and one warning per layout per minute names the layout.
|
|
func TestInlineUnsafeOutput(t *testing.T) {
|
|
t.Parallel()
|
|
brand := &Brand{ButtonPrimaryBg: inlineBrandColour}
|
|
links := []struct{ name, link string }{
|
|
{"plain", `<a href="javascript:alert(1)">x</a>`},
|
|
{"encoded", `<a href="javascript:alert(1)">x</a>`},
|
|
}
|
|
for _, l := range links {
|
|
t.Run(l.name, func(t *testing.T) {
|
|
t.Parallel()
|
|
m, drv := partialsMailer(t, Options{CSS: inlineMedia}, &Overrides{Brand: brand})
|
|
calls := 0
|
|
m.(*mailer).inline = func(html string) (string, error) {
|
|
calls++
|
|
return strings.Replace(html, "</body>", l.link+"</body>", 1), nil
|
|
}
|
|
logs := captureLog(m)
|
|
|
|
ref, refDrv := partialsMailer(t, Options{CSS: inlineMedia}, &Overrides{Brand: brand})
|
|
ref.(*mailer).inline = noInline
|
|
plain := sendTemplate(t, ref, refDrv, "acme.blog::mail.welcome", inlineVars)
|
|
|
|
for range 2 {
|
|
got := sendTemplate(t, m, drv, "acme.blog::mail.welcome", inlineVars)
|
|
if strings.Contains(got.HTML, "javascript") {
|
|
t.Errorf("the failing inlined output was sent:\n%s", got.HTML)
|
|
}
|
|
if css := styleBlock(t, got.HTML); !strings.Contains(css, inlineBrandColour) {
|
|
t.Errorf("the style block lost the Branding CSS:\n%s", css)
|
|
}
|
|
if style := buttonStyle(t, got.HTML); style != "" {
|
|
t.Errorf("the button has an inlined style %q", style)
|
|
}
|
|
if got.Text != plain.Text {
|
|
t.Errorf("text part = %q, want the un-inlined message's %q", got.Text, plain.Text)
|
|
}
|
|
if got.HTML != plain.HTML {
|
|
t.Errorf("the fallback differs from the un-inlined message:\n got %s\nwant %s", got.HTML, plain.HTML)
|
|
}
|
|
}
|
|
if calls != 2 {
|
|
t.Errorf("the inliner ran %d times, want 2", calls)
|
|
}
|
|
out := logs.String()
|
|
if n := strings.Count(out, "inlined CSS failed the safety check"); n != 1 {
|
|
t.Errorf("%d inline warnings in two sends, want 1:\n%s", n, out)
|
|
}
|
|
if !strings.Contains(out, "layout="+defaultLayoutName) || !strings.Contains(out, "dangerous URL scheme") {
|
|
t.Errorf("log = %q, want the layout and the error", out)
|
|
}
|
|
|
|
// The system layout is another key: a second warning.
|
|
sendTemplate(t, m, drv, "acme.blog::mail.auto", nil)
|
|
out = logs.String()
|
|
if n := strings.Count(out, "inlined CSS failed the safety check"); n != 2 || !strings.Contains(out, "layout="+systemLayoutName) {
|
|
t.Errorf("log = %q, want a second warning for the system layout", out)
|
|
}
|
|
})
|
|
}
|
|
}
|