Giter Club home page Giter Club logo

Comments (3)

FlorianRappl avatar FlorianRappl commented on July 30, 2024

No, you need to have some dependency on it. True style computation has to consider the currently applied media rules and the page dimensions. All such values are given / will be given on IWindow. Don't confuse IWindow with a real window / tab. It is not. It is only a concept to hold additional information beyond a pure IDocument. Every IDocument will have its own IWindow associated, with some IWindowProxy being responsible for forwarding the IWindow of the active IDocument in a browsing context (headless browsing).

from anglesharp.

mediabuff avatar mediabuff commented on July 30, 2024

Ok Almost. What about members of IWindow like Alert, Confirm, Close, Stop, Focus - these seem very UI centric. So what would a headless implementation of IWindow ?

from anglesharp.

FlorianRappl avatar FlorianRappl commented on July 30, 2024

These UI methods (same for Click, and others) have to be forwarded / implemented by the user. Usually they would do nothing. If an implementation exists (I haven't thought about a good name, let's call that interface IPresentationService), i.e. if GetService<IPresentationService>() delivers an implementation, the method on the service will be called.
The AnalysisWindow tries to be a draft of a headless window, however, I will probably remove the implementation from AngleSharp. Reason is simple: I want to deliver another library called AngleSharp.Browser, which will contain such implementations. This library will contain (among others):

  • Implementation of IBrowsingContext
  • Implementation of IEventService
  • Implementation of IWindow
  • ... (also currently not drafted ones like IPresentable)

Nevertheless, it follows the same spirit, i.e. even though a default configuration will be made available, everything can be removed / added. So if one wants to use the implementations in AngleSharp.Browser, however, for a real browser / rendering control (not a headless one), then this will be possible.

I am not sure if I should also release AngleSharp.Scripting. Right now this is just a proof of concept and even though rudimentary JavaScript works, it is (performance and technology-wise) far from being ideal. One might argue that having a basic JS engine is better than none, nevertheless, that could be easily archived even without depending on AngleSharp.Scripting directly. So I don't know.

from anglesharp.

Related Issues (20)

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.