Skip to content

Commit

Permalink
Merge branch 'master' into interviewer
Browse files Browse the repository at this point in the history
* master:
  Update changelog
  Add missing requirement to R21
  Internal optimisations to reduce allocations
  Split out property test cases
  Adjust test cases
  Internal cleanup of style properties
  Make R74 and R75 inapplicable to 0-dimension font sizes
  SIA R7 ignore invisible text and fully overwritten attributes (#675)
  Disable Dependabot for now
  Upgrade to Yarn Berry (#258)
  Bump webdriverio from 6.12.1 to 7.0.1 (#700)
  Add user agent styles for form controls
  Switch to native Node.js source map support (#267)
  Bump @angular/core from 11.1.2 to 11.2.0 (#705)
  Bump typescript from 4.1.4 to 4.1.5 (#704)
  Bump @types/chai from 4.2.14 to 4.2.15 (#703)
  Add missing package references
  Add missing package references
  • Loading branch information
kasperisager committed Feb 16, 2021
2 parents 8a900c0 + 160a129 commit 2c71acd
Show file tree
Hide file tree
Showing 133 changed files with 18,935 additions and 12,911 deletions.
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ updates:
directory: "/"
schedule:
interval: "daily"
# https://github.com/dependabot/dependabot-core/issues/1297
open-pull-requests-limit: 0
6 changes: 3 additions & 3 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10, 12, 14]
node-version: [12, 14]
name: Build
steps:
- uses: actions/checkout@v2
Expand All @@ -20,8 +20,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v1
with:
path: .cache/yarn
path: .yarn/cache
key: yarn-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile --ignore-platform --cache-folder .cache/yarn
- run: yarn install --immutable
- run: yarn build
- run: yarn test
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
with:
node-version: 14
registry-url: https://npm.pkg.github.com/
- run: yarn install --frozen-lockfile --ignore-platform
- run: yarn install --immutable
- run: yarn build
- run: yarn test
- run: yarn lerna publish --yes from-package
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
node-version: 14
- uses: actions/cache@v1
with:
path: .cache/yarn
path: .yarn/cache
key: yarn-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile --ignore-platform --cache-folder .cache/yarn
- run: yarn install --immutable
- run: yarn build
- uses: github/codeql-action/init@v1
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
coverage

**/*.log
**/*.tsbuildinfo
Expand Down
8 changes: 8 additions & 0 deletions .yarn/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*
!.gitignore

!**/*.cjs

!releases
!plugins
!versions
55 changes: 55 additions & 0 deletions .yarn/releases/yarn-2.4.0.cjs

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
yarnPath: .yarn/releases/yarn-2.4.0.cjs

# Opt out of Plug'n'Play as it currently requires additional configuration of
# editor SDKs for things like TypeScript and Prettier support.
# https://yarnpkg.com/configuration/yarnrc#nodeLinker
nodeLinker: node-modules
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Items that are related, such as breaking changes, new features, or changes to ex

- [@siteimprove/alfa-result](packages/alfa-result): `Result#tee()` and `Result#teeErr()` are now available.

- [@siteimprove/alfa-parser](packages/alfa-parser): `Parser.teeErr()` is now available.
- [@siteimprove/alfa-parser](packages/alfa-parser): `Parser.Infallible<I, T, A>` and `Parser.teeErr()` are now available.

- [@siteimprove/alfa-array](packages/alfa-array): `Array.forEach()`, `Array.map()`, `Array.flatMap()`, `Array.flatten()`, `Array.filter()`, `Array.reject()`, `Array.includes()`, `Array.collect()`, `Array.collectFirst()`, `Array.some()`, `Array.none()`, `Array.every()`, `Array.count()`, and `Array.distinct()` are now available.

Expand All @@ -45,6 +45,8 @@ Items that are related, such as breaking changes, new features, or changes to ex

- [@siteimprove/alfa-aria](packages/alfa-aria): `Node.from()` now correctly handles children of elements with roles that designate their children as presentational.

- [@siteimprove/alfa-cascade](packages/alfa-cascade): The user agent styles now include previously missing definitions for form controls.

## [0.10.0](../../compare/v0.9.0...v0.10.0) (2021-01-29)

### Breaking
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@
"devDependencies": {
"@types/node": "^14.6.2",
"axios": "^0.21.0",
"execa": "^5.0.0",
"lerna": "^3.19.0",
"lerna": "^3.22.1",
"minimist": "^1.2.0",
"prettier": "2.2.1",
"source-map-support": "^0.5.16",
"typescript": "^4.0.2"
}
}
1 change: 1 addition & 0 deletions packages/alfa-aria/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"generate": "node scripts/attributes.js && node scripts/roles.js"
},
"dependencies": {
"@siteimprove/alfa-array": "^0.10.0",
"@siteimprove/alfa-branched": "^0.10.0",
"@siteimprove/alfa-cache": "^0.10.0",
"@siteimprove/alfa-compatibility": "^0.10.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/alfa-aria/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"test/node.spec.tsx"
],
"references": [
{
"path": "../alfa-array"
},
{
"path": "../alfa-branched"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/alfa-assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"@siteimprove/alfa-formatter-earl": "^0.10.0",
"@siteimprove/alfa-future": "^0.10.0",
"@siteimprove/alfa-mapper": "^0.10.0",
"@siteimprove/alfa-result": "^0.10.0"
"@siteimprove/alfa-result": "^0.10.0",
"@types/node": "^14.14.25"
},
"devDependencies": {
"@siteimprove/alfa-test": "^0.10.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/alfa-cascade/src/selector-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { Iterable } from "@siteimprove/alfa-iterable";
import { Serializable } from "@siteimprove/alfa-json";
import { Media } from "@siteimprove/alfa-media";
import { None, Option } from "@siteimprove/alfa-option";
import { Option } from "@siteimprove/alfa-option";
import { Predicate } from "@siteimprove/alfa-predicate";
import { Refinement } from "@siteimprove/alfa-refinement";
import { Selector, Context } from "@siteimprove/alfa-selector";
Expand Down
46 changes: 46 additions & 0 deletions packages/alfa-cascade/src/user-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,52 @@ export const UserAgent = h.sheet([
display: "none !important",
}),

/**
* @see https://html.spec.whatwg.org/#form-controls
*/

h.rule.style("input, select, button, textarea", {
letterSpacing: "initial",
wordSpacing: "initial",
lineHeight: "initial",
textTransform: "initial",
textIndent: "initial",
textShadow: "initial",
}),

h.rule.style("input, select, textarea", {
textAlign: "initial",
}),

h.rule.style(
"input:is([type=reset i], [type=button i], [type=submit i]), button",
{
textAlign: "center",
}
),

h.rule.style(
"input:is([type=reset i], [type=button i], [type=submit i], [type=color i]), button",
{
display: "inline-block",
}
),

h.rule.style(
"input:is([type=radio i], [type=checkbox i], [type=reset i], [type=button i], [type=submit i], [type=color i], [type=search i]), select, button",
{
boxSizing: "border-box",
}
),

h.rule.style("textarea", { whiteSpace: "pre-wrap" }),

// <button> element defaults applied consistently by browsers.
h.rule.style("button", {
fontStyle: "normal",
fontWeight: "400",
}),

/**
* @see https://html.spec.whatwg.org/#the-hr-element-rendering
*/
Expand Down
1 change: 1 addition & 0 deletions packages/alfa-css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"src/**/*.d.ts"
],
"dependencies": {
"@siteimprove/alfa-array": "^0.10.0",
"@siteimprove/alfa-device": "^0.10.0",
"@siteimprove/alfa-equatable": "^0.10.0",
"@siteimprove/alfa-hash": "^0.10.0",
Expand Down
12 changes: 2 additions & 10 deletions packages/alfa-css/src/syntax/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,14 @@ export namespace Block {
* @see https://drafts.csswg.org/css-syntax/#consume-a-simple-block
*/
export const consume: Parser<Slice<Token>, Block> = (input) => {
const token = input
.get(0)
.filter(
or(
Token.isOpenParenthesis,
or(Token.isOpenSquareBracket, Token.isOpenCurlyBracket)
)
)
.get();
const token = input.array[input.offset] as Open;

const value: Array<Token> = [];

input = input.slice(1);

while (input.length > 0) {
const next = input.get(0).get();
const next = input.array[input.offset];

if (next.type === token.mirror.type) {
input = input.slice(1);
Expand Down
2 changes: 1 addition & 1 deletion packages/alfa-css/src/syntax/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export namespace Component {
* @see https://drafts.csswg.org/css-syntax/#consume-a-component-value
*/
export const consume: Parser<Slice<Token>, Component> = (input) => {
const next = input.get(0).get();
const next = input.array[input.offset];

if (
Token.isOpenParenthesis(next) ||
Expand Down
3 changes: 2 additions & 1 deletion packages/alfa-css/src/syntax/declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ export namespace Declaration {
* @see https://drafts.csswg.org/css-syntax/#consume-a-declaration
*/
export const consume: Parser<Slice<Token>, Declaration, string> = (input) => {
const name = input.get(0).filter(Token.isIdent).get().value;
const { value: name } = input.array[input.offset] as Token.Ident;

const value: Array<Token> = [];

input = input.slice(1);
Expand Down
5 changes: 3 additions & 2 deletions packages/alfa-css/src/syntax/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@ export namespace Function {
* @see https://drafts.csswg.org/css-syntax/#consume-a-function
*/
export const consume: Parser<Slice<Token>, Function> = (input) => {
const name = input.get(0).filter(Token.isFunction).get().value;
const { value: name } = input.array[input.offset] as Token.Function;

const value: Array<Token> = [];

input = input.slice(1);

while (input.length > 0) {
const next = input.get(0).get();
const next = input.array[input.offset];

if (Token.isCloseParenthesis(next)) {
input = input.slice(1);
Expand Down
Loading

0 comments on commit 2c71acd

Please sign in to comment.