#1710 CSS Sidekick does not show parsing errors

open
Dale Anson
None
5
2014-04-28
2013-04-29
RBV
No

For jEdit 5.0.0 with Sidekick 1.4.

The Sidekick parser does not recognize any CSS selectors contained in @Media statements (ala http://www.w3.org/TR/CSS2/media\)

Discussion

  • RBV
    RBV
    2013-04-29

    Screenshot of CSS with @Media section in jEdit Sidekick 1.4

     
  • RBV
    RBV
    2013-04-29

    Oops — uploading a screenshot seems to have also just created this bug. I'd also like to attach a CSS file but can't figure out how to do that.

    Anyhow, in a CSS file that contains an @Media section, Sidekick 1.4 cannot "see" anything contained in that section.

    A simple example is as follows:

    ------ Begin CSS Excerpt ------

    /*<meta />*/

    body
    {
    border: solid 1px #324664;
    margin: 4% 1em 4% 1em;
    padding: 1em 1em 1em 2em;
    line-height: 1.2em;
    font-family: Arial;
    font-size: 0.9em;
    }

    @media print
    {
    body
    {
    margin: 0em;
    border: none;
    padding: 0in;
    }

    ------ End CSS Excerpt ------

    In this example, the Sidekick parser will list the first body selector (and any other selectors in that "default" CSS section, but will not list anything contained within the @media print section.

    Cheers & hope this helps,
    Riley
    SFO

     
  • Dale Anson
    Dale Anson
    2013-04-29

    • summary: Sidekick 1.4 does not process CSS @Media statements --> CSS Sidekick does not show parsing errors
    • assigned_to: nobody --> daleanson
     
  • Dale Anson
    Dale Anson
    2013-04-29

    Check your css -- it's missing a trailing }. When I add it, the css parses in sidekick just fine. Probably not telling you about the parse error is a bug. I've changed the title of this bug so it describes this problem.

    It does show this in the Activity Log when the } is missing:

    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: sidekick.css.parser.ParseException: Encountered "<EOF>" at line 18, column 6.
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: Was expecting one of:
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <S> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <IDENT> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <HASHIDENT> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <HASH> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: "}" ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: "[" ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: "*" ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: ":" ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <LENGTH> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <EMS> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <EXS> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <ANGLE> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <TIME> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <FREQ> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <RESOLUTION> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <DIMEN> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: "::" ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: <CLASS> ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: ":not(" ...
    10:57:46 AM [SwingWorker-pool-1-thread-6] [error] SwingWorker-pool-1-thread-6: "|" ...

     
  • RBV
    RBV
    2013-04-29

    Actually, no — the missing end bracket } for the media section was a copy and paste error.

    I'd love to paste the CSS file but after I added the PNG screenshot that illustrates the problem, I can't figure out how to add the css.( (I'm struggling to navigate and work with this bug reporting system…)

    So here's a pared down version of the CSS that further illustrates the problem:

    ------ End CSS ------

    /*<meta />*/

    body
    {
    border: solid 1px #324664;
    margin: 4% 1em 4% 1em;
    padding: 1em 1em 1em 2em;
    line-height: 1.2em;
    font-family: Arial;
    font-size: 0.9em;
    mc-hyphenate: never;
    }

    @media print
    {
    body
    {
    margin: 0em;
    border: none;
    padding: 0in;
    }

    body.coverContactInfo
    {
    font-family: Arial;
    font-size: 9pt;
    color: #009900;
    font-weight: bold;
    line-height: 1em;
    }

    body.header,
    body.footer
    {
    margin: 0em 0em 0em 0em;
    padding: 0em;
    padding: 0in;
    line-height: 1.0em;
    border: none;
    }
    }

    ------ End CSS ------

    If one puts that example into a .CSS file, ,then parses it with Sidekick, Sidekick lists the first body selector (line 3) below a two-line @media \n print section (line 14). The body selector and classes contained within the @Media print section are not listed.

    Cheers, thanks, & hope this helps,
    Riley

     
  • Dale Anson
    Dale Anson
    2013-06-07

    Screenshot of example css, looks good?

     
    Attachments
  • Dale Anson
    Dale Anson
    2013-06-07

    I put your example css in jEdit, it looks fine in the css sidekick. Notice that all the nodes are sorted by name and in your screenshot, the M's are not visible. Could it be that the media section is there in Sidekick, but not where you are expecting it? Maybe try sorting by line number will resolve the problem?

     
  • RBV
    RBV
    2013-06-07

    Flare CSS file not parsed past Media statement

     
    Attachments
  • RBV
    RBV
    2013-06-07

    Thanks for investing the time to look at this issue. I genuinely hope we can sort it out because jEdit and Sidekick are very useful when used in conjunction with Madcap Flare's project files, particularly in this case its CSS files.

    I've uploaded a CSS file "FlareManuals.css . The uploaded file is used in conjunction with Madcap Flare.

    Some of the attribute constructions use non-standard single quotation marks ('), but they are NOT the problem. The problem, which I verified is manifested in the uploaded file is that nothing below the Media statement on line 356 appears in Sidekick.

    Please see also this discussion thread on the Madcap Software forums:

    http://forums.madcapsoftware.com/viewtopic.php?f=12&t=16864

    The bit about how the Sidekick plugin was initially called to my attention by another user. I then verified the behavior that user described.

    Please do feel free to respond with any questions, comments, rebuttals, etc.

    Cheers, THANKS! again for your help, & have a SUPER weekend,
    Riley
    SFO

     
  • Dale Anson
    Dale Anson
    2013-11-12

    Sorry it's taken so long for me to get back to this. I loaded your attached file "FlareManuals.css". If you change line 491 from

    font-size: 1.em;

    to either
    font-size: 1.0em;
    or
    font-size: 1em;

    then the media print block is parsed just fine. Sidekick does say that line 491 is invalid.

     
  • RBV
    RBV
    2013-12-20

    Sorry it has take me so long to be 'round to this again.

    I have fixed the malformed font-size statement and and sidekick does indeed now list the @media entry on line 348 (of the CSS file attched to this message).

    However sidekick doesn't list any selectors contained within the @media print section. Is it even reasonable of me to expect it to? (I can imagine that duplicate selector names in different media sections might be a problem…)

    Anyhow, I've re-attached my now-fixed CSS file. Sidekick 1.4 in jEdit 5.1.0 doesn't list any of the CSS selectors beyond line 348. I'd like it if did but understand if it can't be done…

    Cheers, thanks 'gain for your help, & Merry / Happy and all that,
    Riley
    SFO

     
  • RBV
    RBV
    2014-03-09

    Dale:

    Thanks but Sidekick still gets stuck at the @media print statement on line 370. I've attached a current CSS file which otherwise appears to be error free. As was the case, Sidekick 1.5 doesn't parse lines beyond the @media statement in the attached file's line number 370.

    What I did this go 'round was use Sidekick 1.5's Sort and Line Numbers settings to list the CSS file's elements in numeric order. In this viewing mode, line #370 is the @media / print statement. It's also the last line in Sidekick's numeric listing of CSS elements by line number, beyond which none of the elements contained in the @media print braces "{}" are listed.

    My apologies in advance if I have a flawed understanding of Sidekick's intended operation or have unreasonable expectations. It's just that jEdit plus Sidekick make working with Madcap Flare CSS so much more efficient that I'd like Sidekick to "do everything".

    Cheers & thanks 'gain for all your help,
    Riley
    SFO

     
    Last edit: RBV 2014-03-09
  • Dale Anson
    Dale Anson
    2014-04-28

    Okay, I've fixed the parsing of @media. It turns out it had never actually been updated to handle all of the CSS 3 modifications and really only worked correctly on CSS 2.1 media queries. I still need to fix the error reporting.

     
  • RBV
    RBV
    2014-04-28

    Dale:

    Thank you SO MUCH for fixing this! Per the attached screenshot it works GREAT!

    Cheers & thanks 'gain,
    Riley
    SFO