0 Replies Latest reply on Sep 9, 2009 7:45 AM by Paul Reilly

    [svn:fx-trunk] 10087: * Feature: Compiler Errors for Other Theme's Styles

    Paul Reilly Level 1

      Revision: 10087

      Author:   preilly@adobe.com

      Date:     2009-09-09 07:44:55 -0700 (Wed, 09 Sep 2009)

       

      Log Message:

      ***********

      • Feature: Compiler Errors for Other Theme's Styles

       

      QE notes: Existing tests will start reporting errors when MXML

                documents with spark style attributes are compiled with the

                halo theme and when halo style attributes are compiled with

                the spark theme.  The same kinds of mismatches in CSS will

                be reported as warnings per the spec.

       

                For the Mxml document errors, the test should be updated to

                use the styles matching the current theme, the test should

                be compiled with a different theme, or the Style metadata

                should be updated to include the current theme.

       

                For the CSS warnings, the styles should be changed to match

                the current theme's styles, the styles should be moved to a

                theme specific CSS document, or the Style metadata should be

                updated to include the current theme.

       

      Doc notes: New option, -compiler.show-invalid-css-property-warnings added.

      Bugs: SDK-17408

      Reviewer: Corey

      Cycloner: Gaurav

      Tests run: checkintests (new valid warnings are reported)

      Is noteworthy for integration: Yes, see QE notes.

      Code-level description of changes:

       

        frameworks/tests/basicTests/graphics/views/comps/TextGraphicBasic1.mxml

        frameworks/tests/basicTests/graphics/views/comps/EllipseBasic2.mxml

        frameworks/tests/basicTests/graphics/views/comps/RectBasic3.mxml

       

          Changed backgroundColor to contentBackgroundColor, because

          Container has backgroundColor declared with the halo theme and

          contentBackgroundColor with the spark theme.

       

        build.xml

       

          Corrected case of BasicTests.mxml and BasicTests.swf.  I guess I'm

          still the only one that runs checkintests on a case sensitive OS.

       

        modules/compiler/src/java/flex2/compiler_en.properties

       

          Added messages for css.StylesContainer.InvalidStyleProperty,

          css.StylesContainer.InvalidStyleTheme, and

          mxml.builder.ComponentBuilder.InvalidStyleTheme.

       

        modules/compiler/src/java/flex2/tools/PreLink.java

       

          Moved backgroundColor handling and StylesContainer validation to

          postRun(), so that it only happens once per compilation.  This

          required passing in the SymbolTable and NameMappings.

       

          Modified run() to only create a global StylesContainer if one

          hasn't been created.

       

        modules/compiler/src/java/flex2/tools/CompcPreLink.java

       

          Updated postRun() to new signature.

       

        modules/compiler/src/java/flex2/compiler/fxg/FXGCompiler.java

       

          Added themeNames variable, which is used to create the TypeTable.

       

        modules/compiler/src/java/flex2/compiler/PreLink.java

       

          Modified postRun() signature by adding SymbolTable and

          NameMappings args.

       

        modules/compiler/src/java/flex2/compiler/CompilerAPI.java

       

          Updated compiler to use the new postRun() signature.

       

        modules/compiler/src/java/flex2/compiler/as3/As3Compiler.java

       

          Modified getParentLoader() to format the super type name before

          looking up the super class.

       

        modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java

       

          Added support for show-invalid-css-property-warnings option.

       

        modules/compiler/src/java/flex2/compiler/common/DefaultsConfigurator.java

       

          Added default for -theme.

       

        modules/compiler/src/java/flex2/compiler/css/StylesContainer.java

       

          Removed StylesContainer(CompilationUnit, ContextStatics,

          MxmlConfiguration) constructor.

       

          Renamed checkForUnusedTypeSelectors() to validate() and added

          logic to check for styles not declared with the current theme and

          styles not declared for a particular type.

       

        modules/compiler/src/java/flex2/compiler/SymbolTable.java

       

          Added getClassNames() for use by StylesContainer.validate().

       

        modules/compiler/src/java/flex2/compiler/mxml/lang/AttributeHandler.java

       

          Removed 'node' variable and modified constructor to initialize 'type'.

       

        modules/compiler/src/java/flex2/compiler/mxml/reflect/Type.java

       

          Added getStyleThemes().

       

        modules/compiler/src/java/flex2/compiler/mxml/reflect/TypeTable.java

       

          Added 'themeNames' variable and modified constructor to initialize

          it.

       

          Added assert to getType() to make sure the className is in colon

          format.

       

          Modified getStyle() only return a StyleHelper if the current theme

          is null, the themeNames is null, or the current theme is in

          themeNames.

       

          Added getStyleThemes() and hasTheme().

       

        modules/compiler/src/java/flex2/compiler/mxml/MxmlConfiguration.java

       

          Added showInvalidCssPropertyWarnings() and getThemeNames().

       

        modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.java

       

          Modified unknown() to check if localPart is a style, but not

          declared with the current theme.  If so, we report an

          InvalidStyleTheme.  Otherwise, we just report that it's unresolved.

       

        modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java

       

          Modified constructor to set the CompilationUnit's StylesContainer.

       

        modules/compiler/src/java/flex2/compiler/mxml/MxmlCompiler.java

       

          Made TYPE_TABLE public, so the css package can share the TypeTable

          rather than create a new one.

       

        modules/compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java

        modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java

       

          Modified TypeTable() creation to pass in the configured theme

          names.

       

      Ticket Links:

      ************

          http://bugs.adobe.com/jira/browse/SDK-17408

       

      Modified Paths:

      **************

          flex/sdk/trunk/build.xml

          flex/sdk/trunk/frameworks/tests/basicTests/graphics/views/comps/EllipseBasic2.mxml

          flex/sdk/trunk/frameworks/tests/basicTests/graphics/views/comps/RectBasic3.mxml

          flex/sdk/trunk/frameworks/tests/basicTests/graphics/views/comps/TextGraphicBasic1.mxml

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerAPI.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/PreLink.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/SymbolTable.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/As3Compiler.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/DefaultsConfigurator.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/MxmlConfiguration.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/config/CommandLineConfigurator.ja va

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StylesContainer.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/fxg/FXGCompiler.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/MxmlCompiler.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/MxmlConfiguration.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.jav a

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/AttributeHandler.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/DeclarationHandler.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Type.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/TypeTable.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler_en.properties

          flex/sdk/trunk/modules/compiler/src/java/flex2/tools/CompcPreLink.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java