Skip to content

FIX: remove secretly overwriting fields#512

Open
LeventDag wants to merge 1 commit into
w3c:mainfrom
Handig-Eekhoorn:remove_overwriting_value_variables
Open

FIX: remove secretly overwriting fields#512
LeventDag wants to merge 1 commit into
w3c:mainfrom
Handig-Eekhoorn:remove_overwriting_value_variables

Conversation

@LeventDag

Copy link
Copy Markdown

Hello @ylafon,

your fix of #508 (comment) exposed another issue in the code. However it seems to be an easy fix.

I've prepared a testcase for this aswell.

Description

So it seems that some CSS Property extending classes have a field public CssValue value; property set although the parent class already has these. So the value of the Parent gets set because of casting, however the output template doesn't cast and therefore uses the implementations field which is null.

Input

/* display */
.a { display: flex; }
.b { display: grid; }
.c { display: none; }

/* marks */
@page {
    marks: crop cross;
}

/* counter-style: system + suffix */
@counter-style custom {
    system: fixed;
    symbols: A B C;
    suffix: ". ";
}

/* media feature */
@media (min-width: 320px) { .d { display: block; } }

/* media feature range */
@media (400px <= width <= 1000px) { .e { display: inline; } }

/* max-height */
@media (max-height: 800px) { .f { display: flex; } }

/* min-width */
@media (min-width: 1024px) { .g { display: grid; } }

/* max-zoom */
@media (max-zoom: 3) { .h { display: block; } }

/* orientation */
@media (orientation: portrait) { .i { display: flex; } }
@media (orientation: landscape) { .j { display: inline-flex; } }

/* font-face */
@font-face {font-family: 'Roboto'; font-style: normal; font-weight: 400; font-stretch: normal; src: url(r2.ttf) format('truetype'); }
@font-face {font-family: 'Roboto'; font-style: normal; font-weight: 700; font-stretch: normal; src: url(r1.ttf) format('truetype'); }

Result on main

Output on main commit 1ab7ea8

Warnings (6)

URI : file:_11_font_face_with_stretch.css

Line : 31 -  “max-zoom” is a vendor extension
Line : 39 -  Redefinition of “font-family”
Line : 39 -  Redefinition of “font-style”
Line : 39 -  Redefinition of “font-weight”
Line : 39 -  Redefinition of “font-width”
Line : 39 -  Redefinition of “src”



Valid CSS information
    .a
    {
        display : flex ;
    }
    .b
    {
        display : grid ;
    }
    .c
    {
        display : none ;
    }

@page
{
        marks : $property ;

}

@counter-style custom
{
        system : $property ;
        symbols : $property ;
        suffix : $property ;

}

@media  (min-width: 320px)
{
    .d
    {
        display : block ;
    }

}

@media  (400px <= width <= 1000px)
{
    .e
    {
        display : inline ;
    }

}

@media  (max-height: 800px)
{
    .f
    {
        display : flex ;
    }

}

@media  (min-width: 1024px)
{
    .g
    {
        display : grid ;
    }

}

@media 
{
    .h
    {
        display : block ;
    }

}

@media  (orientation: portrait)
{
    .i
    {
        display : flex ;
    }

}

@media  (orientation: landscape)
{
    .j
    {
        display : inline-flex ;
    }

}

@font-face
{
        font-family : $property ;
        font-style : normal ;
        font-weight : 400 ;
        font-width : normal ;
        src : $property ;

}

@font-face
{
        font-family : $property ;
        font-style : normal ;
        font-weight : 700 ;
        font-width : normal ;
        src : $property ;

}

Result on pullrequest

Output with this fix

Warnings (6)

URI : file:_11_font_face_with_stretch.css

Line : 31 -  “max-zoom” is a vendor extension
Line : 39 -  Redefinition of “font-family”
Line : 39 -  Redefinition of “font-style”
Line : 39 -  Redefinition of “font-weight”
Line : 39 -  Redefinition of “font-width”
Line : 39 -  Redefinition of “src”



Valid CSS information
    .a
    {
        display : flex ;
    }
    .b
    {
        display : grid ;
    }
    .c
    {
        display : none ;
    }

@page
{
        marks : crop cross ;

}

@counter-style custom
{
        system : fixed ;
        symbols : A B C ;
        suffix : ". " ;

}

@media  (min-width: 320px)
{
    .d
    {
        display : block ;
    }

}

@media  (400px <= width <= 1000px)
{
    .e
    {
        display : inline ;
    }

}

@media  (max-height: 800px)
{
    .f
    {
        display : flex ;
    }

}

@media  (min-width: 1024px)
{
    .g
    {
        display : grid ;
    }

}

@media 
{
    .h
    {
        display : block ;
    }

}

@media  (orientation: portrait)
{
    .i
    {
        display : flex ;
    }

}

@media  (orientation: landscape)
{
    .j
    {
        display : inline-flex ;
    }

}

@font-face
{
        font-family : 'Roboto' ;
        font-style : normal ;
        font-weight : 400 ;
        font-width : normal ;
        src : url(r2.ttf) format('truetype') ;

}

@font-face
{
        font-family : 'Roboto' ;
        font-style : normal ;
        font-weight : 700 ;
        font-width : normal ;
        src : url(r1.ttf) format('truetype') ;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant