<?xml version="1.1" encoding="UTF-8"?>
<!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 3.0 Language//EN" "http://www.w3.org/2008/SMIL30/SMIL30Language.dtd">
<!--
Copyright: Copyright 1998-2008 W3C (MIT, ERCIM, Keio), All Rights Reserved.
See http://www.w3.org/Consortium/Legal/2008/04-testsuite-license.

Author: Daniel WECK (DAISY Consortium).

Version: January 08, 2008
Chapter: SMIL 3.0 Layout
Module: OverrideLayout Module
Feature: backgroundOpacity
File Name: layout-background-opacity-region-override.smil

Additional Files: "ColorQuad_NoText.png"
Additional Files: "ColorQuad_WithText.png"
Additional Files: "text.txt"

Expected Behavior:

A 640px by 640px base canvas is displayed with a red background color (#FF0000), and a region is displayed in the upper left corner to exactly a quarter of the size of the base canvas. This region is displayed with a blue background set at 50% opacity, therefore resulting in the #7f0080 color.

At 5s, a text media (text.txt) displays inside this region and overrides the background opacity to 0.75, resulting in the #4000bf color. The text ends after 5s, resulting in the region's background color returning to its original blue background at 0.5 opacity (#7f0080).

Another 2 reference regions are displayed to compare the expected color in the first region: the on in the lower-right corner uses a 75% blue background, the one in the lower-left corner uses a plain solid background at #4000bf (both these additional comparison regions should look exactly the same, as #4000bf is the color obtained with blue 75% opaque on a red background).

2 images are provided to represent the expected visuals from the test described above: the first one named "ColorQuad_NoText.png" corresponds to the stage before the text appears, while "ColorQuad_WithText.png" corresponds to the stage after the text has appeared.

-->
<smil xmlns="http://www.w3.org/ns/SMIL" version="3.0" baseProfile="Language">
  <head>
    <layout>
      <root-layout width="640" height="640" backgroundColor="red"/>

      <!-- Expected behaviour of the following region (when no media is active within it):
           blue half-transparent background, therefore the visible color is the combination of red and blue pigments: #7f0080 (using percentage value).
      -->
      <region showBackground="always" xml:id="region_text" left="0" top="0" width="50%" height="50%" backgroundColor="blue" backgroundOpacity="50%"/>

      <region showBackground="always" xml:id="region_text_compare1" left="50%" top="50%" width="50%" height="50%" backgroundColor="blue" backgroundOpacity="75%"/>

      <region showBackground="always" xml:id="region_text_compare2" left="0" top="50%" width="50%" height="50%" backgroundColor="#4000bf"/>
    </layout>
  </head>
  <body dur="indefinite">

    <!-- Expected behaviour:
         the text media overrides the background opacity to 0.75, resulting in the #4000bf color. The text ends after 5s, resulting in the region's background color returning to its original blue background at 0.5 opacity (#7f0080).
    -->
    <text begin="5s" dur="5s" src="text.txt" region="region_text" backgroundOpacity="0.75"/>
  </body>
</smil>
