CSS Regions testing strategy

Unofficial Draft 12 August 2013

Test suite:
http://test.csswg.org/suites/css3-regions/nightly-unstable/
Editor:
Mihai Balan, Adobe Systems, Inc.,

Abstract

This document is intended to be used as a guideline for the testing activities related to the CSS Regions spec [css3-regions]. Its main goal is to provide an overview of the general testing areas, possible caveats and testing aspects not immediately apparent from the spec. Also, it provides a means of tracking the progress of the CSS Regions spec testing.

This document is not meant to replace the spec in determining the normative and non-normative assertions to be tested, but rather complement it.

Status of This Document

This document is merely a public working draft of a potential specification. It has no official standing of any kind and does not represent the support or consensus of any standards organisation.

Table of Contents

1. Introduction

As CSS moved away from the monolithic development of CSS 2.1 to the modular development of CSS 3, the number of proposed new features and the complexity of the layout landscape have increased dramatically. While this directly translates to increased flexibility and agility in adopting and implementing new CSS features, it also increases the complexity of testing CSS features and the need for coordinating the testing efforts. Also, the need for testing coordination increases as crowd-sourcing efforts like Test the Web Forward present people less familiar with the processes and policies of the W3C with the opportunity to contribute new tests.

Except when defining new behaviors or redefining old behaviors, the implicit assumption for new CSS modules is that they play nicely with other modules or properties defined in CSS 2.1 [CSS21]. As CSS Regions is a spec that touches many aspects of layout, styling and CSSOM, it's not unreasonable to want to test the spec against these implicit assumptions, too.

This testing strategy document is meant to complement the CSS Regions spec and the existing test suite by providing an overview of the testing areas (especially the less apparent ones) and tracking the progress of the testing activities against these test areas.

2. Goals

To ensure a comprehensive test suite with useful, high quality tests, a number of goals are proposed. They range from process goals (how to conduct testing) to implementation goals (how to write good tests).

2.1 Enabling easy test contribution

An important vector in creating successfully testing CSS Regions is to enable easy test contributions, both from W3C partners and from non-W3C members that wish to contribute. This is achieved by clearly marking and explaining the areas that need testing, linked to existing tests and general testing progress.

2.2 Providing guidance on testing

In order to increase the quality of the test contributions, this document offers a set of guidelines for conducting testing (see section 4. Approach) and a testing progress tracker to increase the surface coverage of tests (see section 7. Test progress tracking).

2.3 Creating automation-friendly tests

In terms of actual tests produced for the CSS Regions, the main goal is to ensure that most tests are automatable (i.e. they're either reftests or use testharness.js). Even where manual tests are absolutely necessary they should be written so that they can be easily automated – as there are on-going efforts to make WebDriver [webdriver] automated tests a first class citized in W3C testing. This means that even if a manual test requires user interaction, the validation or PASS/FAIL conditions should still be clear enough as to allow automatic validation if said interaction is later automated.

3. Risks and mitigation

There are a number of risks associated with creating a high-quality test suite for CSS Regions. The most important ones are listed below.

3.1 Implicit interactions with a lot of other specs (and commonly accepted browser behavior)

The CSS Region spec introduces a significant change in the way layout can be done and as a consequence, many of the assumptions that hold in the context of CSS 2.1 must be re-validated in the context of CSS Regions. In the meanwhile, a lot of new layout modules have been proposed, with various degrees of implementor support and maturity. Also, non-CSS specific specs introduced concepts that affect how style is propagated (e.g. Shadow DOM [shadow-dom]) or how elements are rendered and interact with their containing documents (e.g. <iframe seamless> in HTML 5 [HTML5]).

All the above factors increase the testing surface and the number of the possible cases that might need an explicitly specified behavior in order to ensure intuitive and not-unexpected results as well as stable interaction with widely used browser features (that might not be yet so strictly specified).

In terms of specifying the expected behavior, the current approach is to try and specify it for specs that are final or nearly-final and to just make a note of the possible interactions and unspecified behaviors in the case of specs that are still in flux. In exceptional cases, a new spec might be created to cater for the needs of multiple specs (e.g. the CSS Fragmentation spec [css3-break]).

3.2 Big number of tests required

Note
Add here the estimation of tests required produced by W3C test coverage tool. If possible, provide a better informed guess on the number of tests.

Given the complexity of the spec, a big number of tests will need to be created to produce a test suite that can ensure interoperability between implementations.

In this context, the main purpose of this document is to provide useful informations for creating and contributing tests in an effective manner in terms of coverage and test quality.

4. Approach

As spec testing cannot be realistically separated from testing a particular implementation (except for the very simple cases), the approach proposed for testing is one that tries to first cover as many areas as possible, instead of deep diving on a certain feature or aspect of the spec first. A side benefit of this approach is that the spec tests can be used at any time to gauge the level of support of a certain implementation.

Having this breadth-first approach in mind, tests will be created for the testing areas listed in section 5. Testing areas. Testing will be done in multiple passes, each aimed at covering more specific edge-cases.

5. Testing areas

5.1 Explicit testing areas

These are testing areas normatively defined by the spec. They cover things explicitly or implicitly defined in the CSS Regions spec. Please note that while detailed, this list is not necessarily exhaustive and normative behaviors may not be contained in it. When in doubt, consult the CSS Regions spec or ask a question on the mailing list.

Below is the list of explicit testing areas:

  1. Proper parsing of the CSS properties and rules, rendering according to the spec.
    • flow-into and flow-from; flow-into should be tested both with and without the content switch
    • region-fragment
    • the ::region() functional pseudo-element
    • fragmentation additions: region-avoid, region-always – see [css3-break] for details
  2. Nested named flows and cycle detection
  3. Multi-column regions
  4. Regions' pseudo-elements
  5. Region styling
  6. Region auto-sizing (regions visual formatting details)
  7. CSSOM - interfaces implemented, behavior according to the spec
    • NamedFlow interface
    • Region interface
    • regionoversetchange event
    • regionfragmentchange event
  8. DOM additions
    • getClientRects() and getBoundingClientRects()
    • offsetTop, offsetBottom, offsetLeft, offsetRight and offsetParent

5.2 Implicit testing areas

These are testing areas either normatively defined in other specs that explicitly refer to the CSS Regions spec (e.g. [css3-break]) or simply not explicitly defined, but implied by various aspects of the spec (e.g. processing model, CSS 2.1 compliance, etc.). Please note that while detailed, this list is not necessarily exhaustive and normative behaviors may not be contained in it. When in doubt, consult the CSS Regions spec or ask a question on the mailing list.

Below is the list of implicit testing areas:

  1. CSS Regions and layout modules:
  2. CSS Regions and different types of elements
    • List items
    • <iframe>
      • fragmentation of <iframe> and <iframe seamless>
    • <video>
    • <canvas>
    • <table>
  3. Region styling and <style scoped>
  4. Stacking contexts
  5. Fragmentation
    • Named flow content fragmentation
    • Regions fragmentation
  6. Dynamic content – dynamically changing the named flows or the region chain
  7. Writing modes
  8. User input events (e.g. mouse, touch, keyboard); this includes event propagation
  9. User action pseudo-classes (e.g. :active, :hover)
  10. Transforms
  11. Transitions and animations
  12. Shadow DOM
    • Regions inside shadow trees
    • Flowing content from shadow trees
  13. Content clipping and overflowing
  14. Pseudo-elements in named flow contents

6. People and responsibilities

Below is a list of people you should reach out to if you have any questions related to this document or testing CSS Regions in general:

7. Test progress tracking

Currently test progress tracking is done via gitHub milestones and issues. Each testing level has a corresponding milestone with issues created for each testing area. Currently, only the milestones for smoke-level testing have been created, with milestones for the second pass of testing to be added soon.

Note
Ownership of the repo containing these issues and milestones should be transferred to either the Adobe Web Platform organization or to the W3C organization.

A. References

A.1 Normative references

[css3-break]
Rossen Atanassov; Elika Etemad. CSS Fragmentation Module Level 3. 23 August 2012. W3C Working Draft. URL: http://www.w3.org/TR/css3-break/
[css3-regions]
Vincent Hardy; Rossen Atanassov; Alan Stearns. CSS Regions Module Level 1. 28 May 2013. W3C Working Draft. URL: http://www.w3.org/TR/css3-regions/

A.2 Informative references

[CSS21]
Bert Bos et al. Cascading Style Sheets, level 2 (CSS2) Specification. 07 June 2011. W3C Recommendation. URL: http://www.w3.org/TR/CSS21/
[HTML5]
Robin Berjon et al. HTML5. 17 December 2012. W3C Candidate Recommendation. URL: http://www.w3.org/TR/html5/
[css-shapes-1]
Vincent Hardy; Rossen Atanassov; Alan Stearns. CSS Shapes Module Level 1. 20 June 2013. W3C Working Draft. URL: http://www.w3.org/TR/css-shapes-1/
[css3-flexbox]
Tab Atkins Jr.; Elika Etemad; Alex Mogilevsky. CSS Flexible Box Layout Module. 18 September 2012. W3C Candidate Recommendation. URL: http://www.w3.org/TR/css3-flexbox/
[css3-grid-layout]
Tab Atkins Jr.; Elika Etemad; Rossen Atanassov. CSS Grid Layout. 2 April 2013. W3C Working Draft. URL: http://www.w3.org/TR/css3-grid-layout/
[css3-multicol]
Håkon Wium Lie. CSS Multi-column Layout Module. 12 April 2011. W3C Candidate Recommendation. URL: http://www.w3.org/TR/css3-multicol
[shadow-dom]
Dimitri Glazkov. Shadow DOM. 14 May 2013. W3C Working Draft. URL: http://www.w3.org/TR/shadow-dom/
[webdriver]
Simon Stewart; David Burns. WebDriver. 12 March 2013. W3C Working Draft. URL: http://www.w3.org/TR/webdriver/