CSS pseudo elements ::before and ::after support

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

CSS pseudo elements ::before and ::after support

RuralHunter
Hi,

Does htmlunit support the CSS pseudo elements ::before and ::after? If
yes, how to get it on the html element?


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user
Reply | Threaded
Open this post in threaded view
|

Re: CSS pseudo elements ::before and ::after support

Ronald Brill
Hi Rural,

not sure what you are looking for. Maybe ask the element for the computed css style and
then check for the attribute....

On Tue, 20 Jun 2017 15:34:39 +0800 Rural Hunter wrote:
>
>Hi,
>
>Does htmlunit support the CSS pseudo elements ::before and ::after? If yes, how to get it
on the html element?
>
>
>-----------------------------------------------------------------------
-------
>Check out the vibrant tech community on one of the world's most
>engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>_______________________________________________
>Htmlunit-user mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/htmlunit-user
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user
Reply | Threaded
Open this post in threaded view
|

Re: CSS pseudo elements ::before and ::after support

RuralHunter
Thanks Ronald. I already get it working like this:
                 HTMLElement element=(HTMLElement)he.getScriptableObject();
                 ComputedCSSStyleDeclaration
style=jscript.getComputedStyle(element, ":before");
The important thing is the pseudo parameter of getComputedStyle method
has to be ":before", not "before" or "::before". I think this should be
documented.

在 2017/6/27 0:01, Ronald Brill 写道:

> Hi Rural,
>
> not sure what you are looking for. Maybe ask the element for the computed css style and
> then check for the attribute....
>
> On Tue, 20 Jun 2017 15:34:39 +0800 Rural Hunter wrote:
>> Hi,
>>
>> Does htmlunit support the CSS pseudo elements ::before and ::after? If yes, how to get it
> on the html element?
>>
>> -----------------------------------------------------------------------
> -------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Htmlunit-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user
>>
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user
Reply | Threaded
Open this post in threaded view
|

Re: CSS pseudo elements ::before and ::after support

Ronald Brill
Ok you are rigth - at least partly ;-)

Have updated the documentation -> please check if this is sufficient for you.

This method is there for js support so i have added one more test. Looks like the browsers can handle ':before' and '::before'. This is now also fixed, we are in sync with the browsers now.

Thanks for your report

        RBRi

On Tue, 27 Jun 2017 09:43:55 +0800 Rural Hunter wrote:

>
>Thanks Ronald. I already get it working like this:
>                HTMLElement element=(HTMLElement)he.getScriptableObject();
>                ComputedCSSStyleDeclaration style=jscript.getComputedStyle(element, ":before");
>The important thing is the pseudo parameter of getComputedStyle method has to be ":before", not "before" or "::before". I think this should be documented.
>
>ÔÚ 2017/6/27 0:01, Ronald Brill ??µ?:
>>Hi Rural,
>>
>>not sure what you are looking for. Maybe ask the element for the computed css style and
>>then check for the attribute....
>>
>>On Tue, 20 Jun 2017 15:34:39 +0800 Rural Hunter wrote:
>>>Hi,
>>>
>>>Does htmlunit support the CSS pseudo elements ::before and ::after? If yes, how to get it
>>on the html element?
>>>
>>>-----------------------------------------------------------------------
>>-------
>>>Check out the vibrant tech community on one of the world's most
>>>engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>_______________________________________________
>>>Htmlunit-user mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/htmlunit-user
>>>
>>
>
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user
Reply | Threaded
Open this post in threaded view
|

Re: CSS pseudo elements ::before and ::after support

RuralHunter
Hi Ronald,

Thanks a lot. That's enough for me. :)

在 2017/6/28 0:31, Ronald Brill 写道:

> Ok you are rigth - at least partly ;-)
>
> Have updated the documentation -> please check if this is sufficient for you.
>
> This method is there for js support so i have added one more test. Looks like the browsers can handle ':before' and '::before'. This is now also fixed, we are in sync with the browsers now.
>
> Thanks for your report
>
> RBRi
>
> On Tue, 27 Jun 2017 09:43:55 +0800 Rural Hunter wrote:
>> Thanks Ronald. I already get it working like this:
>>                 HTMLElement element=(HTMLElement)he.getScriptableObject();
>>                 ComputedCSSStyleDeclaration style=jscript.getComputedStyle(element, ":before");
>> The important thing is the pseudo parameter of getComputedStyle method has to be ":before", not "before" or "::before". I think this should be documented.
>>
>> ÔÚ 2017/6/27 0:01, Ronald Brill ??µ?:
>>> Hi Rural,
>>>
>>> not sure what you are looking for. Maybe ask the element for the computed css style and
>>> then check for the attribute....
>>>
>>> On Tue, 20 Jun 2017 15:34:39 +0800 Rural Hunter wrote:
>>>> Hi,
>>>>
>>>> Does htmlunit support the CSS pseudo elements ::before and ::after? If yes, how to get it
>>> on the html element?
>>>> -----------------------------------------------------------------------
>>> -------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>> _______________________________________________
>>>> Htmlunit-user mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user
>>>>
>>
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user