diff --git a/samples/TestApplication/html.htm b/samples/TestApplication/html.htm index 764e9511c6..3b0ee9e8e3 100644 --- a/samples/TestApplication/html.htm +++ b/samples/TestApplication/html.htm @@ -1,170 +1,111 @@
--- There are some additional features that you may already discovered about the renderer - core engine.
-- Graphic features
-- I have always wanted the W3C to add this features to the CSS spec (and so far, not - there yet :)
+++
+
+ Lightweight (~300K). +High performance and low memory footprint. +Extendable and configurable. -- And I think many many web designers would agree. Is it so hard or what?.
- Background Gradients
-- It is a simple two color linear gradient, achieved by the adding of two CSS properties:
--
- Some examples - -- -
background-gradient: (#Color)- Second color of the gradient background, - the first one is given bybackground-color. Not inherited.- -
background-gradient-angle: (number)- Angle (in degrees, clockwise) of - the gradient. Not inherited. Initial value:90-
+ Limitations + +- -- -- -- -- -- -- -- 0 degrees - -- 45 degrees - -- 90 degrees - -- 135 degrees - -- 180 degrees - -+
+- All HTML end tags marked as + optional should be there. No problem with tags marked as forbidden.
+
- Rounded corners
-- As you may already know, CSS is based on a - Box Model, where every box has it's own set of properties. Since we are - talking abound boxes, why not to make them with rounded corners, almost every - website you visit nowadays makes use of rounded corners, where a not very nice trick - with images and tables must be used.
-- In this renderer, the rounded corners are achieved by adding this CSS properties:
+ On the roadmap + Of course it's not quite finished yet. Here are some of the important things to + do.-
- - Some examples -- -
corner-ne-radius: (length)Indicates the radius of the north-east corner. - Not ineritted- -
corner-se-radius: (length)Indicates the radius of the south-east corner. - Not ineritted- -
corner-sw-radius: (length)Indicates the radius of the south-west corner. - Not ineritted- -
corner-nw-radius: (length)Indicates the radius of the north-west corner. - Not ineritted- +
corner-radius: (length){1,4}Shorthand for the other corner properties. - Not ineritted- Better performance
+- Support of position CSS property
+- Support of height and min-height CSS property
+- Better tables support, especially layouts
+- Support image align
+- Handle :hover selector
+- Selection by shift+arrows
+- Better HTML tag parsing (optional closing tags)
+- More styles support
-
-- -- --
--
-- c1 - -- c2 - -- c3 - -- c4 - -- c5 - -.c1, .c2, .c3, .c4, .c5 { background-color:olive; border:0px; color:white; vertical-align:middle; } -.c1 { corner-radius: 0px } -.c2 { corner-radius: 10px } -.c3 { corner-radius: 0px 10px 10px 0px } -.c4 { corner-radius: 18px } -.c5 { corner-radius: 10px; border: outset #bb0 2px; }++ Vision +
++
+- Most complete static HTML Renderer (no java script).
+- Commercial web browser performance level.
+
++ 2015 - Nikita Tsukanov (Perspex Port) + +
++ https://perspex.github.io/ ++ ++ 2012 - Arthur Teplitzki +
++ http://TheArtOfDev.com +++ 2009 - Jose Manuel Menendez Poo +
++ www.menendezpoo.com +\ No newline at end of file diff --git a/src/Perspex.HtmlRenderer/Adapters/ControlAdapter.cs b/src/Perspex.HtmlRenderer/Adapters/ControlAdapter.cs index be9be611e5..3f76af92e1 100644 --- a/src/Perspex.HtmlRenderer/Adapters/ControlAdapter.cs +++ b/src/Perspex.HtmlRenderer/Adapters/ControlAdapter.cs @@ -39,8 +39,6 @@ namespace TheArtOfDev.HtmlRenderer.Perspex.Adapters ArgChecker.AssertArgNotNull(control, "control"); _control = control; - _control.PointerPressed += delegate { _leftMouseButton = true; }; - _control.PointerPressed += delegate { _leftMouseButton = false; }; } ///@@ -60,7 +58,7 @@ namespace TheArtOfDev.HtmlRenderer.Perspex.Adapters } private bool _leftMouseButton; - public override bool LeftMouseButton => _leftMouseButton; + public override bool LeftMouseButton => (_control as HtmlControl)?.LeftMouseButton ?? false; public override bool RightMouseButton { diff --git a/src/Perspex.HtmlRenderer/Adapters/GraphicsAdapter.cs b/src/Perspex.HtmlRenderer/Adapters/GraphicsAdapter.cs index e0da822676..415363a5c0 100644 --- a/src/Perspex.HtmlRenderer/Adapters/GraphicsAdapter.cs +++ b/src/Perspex.HtmlRenderer/Adapters/GraphicsAdapter.cs @@ -205,6 +205,8 @@ namespace TheArtOfDev.HtmlRenderer.Perspex.Adapters public override void Dispose() { + while (_clipStack.Count != 0) + PopClip(); if (_releaseGraphics) _g.Dispose(); } diff --git a/src/Perspex.HtmlRenderer/HtmlContainer.cs b/src/Perspex.HtmlRenderer/HtmlContainer.cs index 729613f5d1..a97987e90d 100644 --- a/src/Perspex.HtmlRenderer/HtmlContainer.cs +++ b/src/Perspex.HtmlRenderer/HtmlContainer.cs @@ -376,7 +376,7 @@ namespace Perspex.Controls { ArgChecker.AssertArgNotNull(parent, "parent"); ArgChecker.AssertArgNotNull(e, "e"); - + _htmlContainerInt.HandleMouseDown(new ControlAdapter(parent), Util.Convert(e.GetPosition(parent))); } diff --git a/src/Perspex.HtmlRenderer/HtmlControl.cs b/src/Perspex.HtmlRenderer/HtmlControl.cs index 87d06a1864..66c2289ebb 100644 --- a/src/Perspex.HtmlRenderer/HtmlControl.cs +++ b/src/Perspex.HtmlRenderer/HtmlControl.cs @@ -127,6 +127,9 @@ namespace Perspex.Controls _htmlContainer.ImageLoad += (_, e) => OnImageLoad(e); } + //Hack for adapter + internal bool LeftMouseButton { get; private set; } + /// /// Raised when the set html document has been fully loaded.
/// Allows manipulation of the html dom, scroll position, etc. @@ -397,6 +400,7 @@ namespace Perspex.Controls protected override void OnPointerPressed(PointerPressEventArgs e) { base.OnPointerPressed(e); + LeftMouseButton = true; _htmlContainer?.HandleLeftMouseDown(this, e); } @@ -408,6 +412,7 @@ namespace Perspex.Controls protected override void OnPointerReleased(PointerEventArgs e) { base.OnPointerReleased(e); + LeftMouseButton = false; if (_htmlContainer != null) _htmlContainer.HandleLeftMouseUp(this, e); }