Git Product home page Git Product logo

csscritic's People

Contributors

0xflotus avatar cburgmer avatar dependabot[bot] avatar flosell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csscritic's Issues

test generator and ui

(continuing from twitter)

here is how i imagine it:

after initial set up (which probably needs dev support) a designer can run a generator script against a css file.

this generates tests for all selectors in the file.

a ui lets you pick the tests you want to keep (in the way you already mark failed tests as accepted).

this approach would remove the need for the generator to be intelligent in any way (eg recognize components, as you mentioned).

then again, the script maybe could also be run directly against a selector. that already would be a huge help in setting up initial tests before refactoring.

Allow testing against a deployed site

In some instances we might not be able to integrate testing into the application and run tests against a local code base. The same origin restriction doesn't allow us to test against a deployed website served from a different origin.

Don't do 2 AJAX requests for HTML pages

Now that we support loading images we currently do two requests if the url is not an image, i.e. a HTML page. We should take the content returned from the first request and directly pass this to rasterizeHTML instead of starting the second request.

Actual page has different font rendering than reference in browser

Font's seem not to be rendered using antialiasing inside the canvas triggering different renderings. While this doesn't affect the diffing, it makes it harder to spot the differences.

We should try rendering the actual page inside a canvas element, as the reference image is calculated by going through a canvas.

Firefox seems to ignore a font-face url() if local() is given

When defining a font-face rule including a local() directive such as

@font-face {
  font-family: "font";
  font-style: normal;
  font-weight: 700;
  src: local("font"), url(font.ttf) format("truetype");
}

Firefox seems to ignore the definition.

Removing the local() bit seems to solve that.

Resizing of page canvas jumps to top of the page in Firefox

If a test fails or a reference has yet to be created, the rendered page can be changed in size by dragging the handle in the lower right cornet. Doing so will scroll to the top of the page if the page has so much output that it is scrollable in the browser and the test in question is shown in the lower part.

Provide a "reset.css" to cope with certain default styles not being applied

Pages under test are rendered as bitmap in the browser through SVG. Certain browser styles are not applied when rendering HTML inside SVG which result in an incomplete/wrong rendering.

One example seems to be links (anchors "a"). Both coloring and underlining is missing.

A solution would be to provide a "reset.css"-like style by default when rendering pages.

localStorage quota reached

At around ~50 large test cases Firefox' localStorage quota is reached throwing a NS_ERROR_DOM_QUOTA_REACHED.

Accepting further images as reference then silently fails.

ID in tested pages clashes with runner

Corner case:

The BasicHtmlReporter uses an id, which when CSS critic tests itself will clash with the "workaround SVG" being written by rasterizeHTML.js once more than one page is tested.

Putting the workaround SVG into an iframe solves the issue, but makes Firefox more flaky which is what the workaround is actually tries to circumvent.

Possible solutions:

  • wait for the workaround to become obsolete
  • find a different workaround that doesn't include adding the SVG to the DOM

Integrate fingerprinting

Signing off on a file's fingerprint is currently implemented as a reporter. This has some technical limitations and should find its way into the core instead.

Add smoke test for allinone bundle

The allinone bundle and ./csscritic.js are a central entry points to the application. They should be smoke tested after a successful build.

Unicode is garbled

Unicode in HTML documents is garbled when loading URLs in the browser.

Background:

To render both images and HTML currently everything is loaded as binary and thus non-ASCII text is not correctly decoded. Apparently XHR needs to be told in advance whether binary data or text is expected and thus doesn't leave us with many choices.

Solutions:

  • Find a workaround for loading both types through once request
  • Do 2 requests worst case, a second one in case the first was the wrong binary/text setting
  • Detect content tpye from path extension (.png, .gif, .jpe?g -> binary, * -> text)

Better show slight differences in color on failing tests

If a test fails on a difference of only few pixels in addition to a slight color difference producing a next to black color this error is not directly visible. This leads to the developer believing in false positive test errors.

A hyperbolic multiplier could put more weight on small changes.

NiceReporter missing features

The NiceReporter should replace the BasicHTMLReporter in the future. There's a bit of things missing though:

  • Show errored page
  • Show page load errors
  • Feedback on 'accept'
  • Resizable image
  • Mouseover hints
  • Total execution time
  • Test parameters

Support specific selector to narrow test to certain element

Consider the following problem:

Although you have broken down your CSS + HTML into small components you still might want to only test a certain subset of the actual page.

Especially when testing against page object code (JS) and corner cases in the view implementation one might only be interested in parts of the page.

Testing against the full page will make more tests break when refactoring and accepting changed test cases will be the norm making it more likely to miss actual breaking cases.

Resizing in Chrome & Safari is cumbersome

Resizing an element at the bottom of the page can only happen in minimum steps, as the cursor quickly hits the lower edge of the screen. Also when leaving the browser window, the mouse release is not triggered, thus not repainting the inner canvas.

While css critic is not functional in both of these browsers, for demo purposes it would be nice if at least the main UI works as intended.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.