MM-8867

While performing some inlining of some various websites we discovered that HTML5 tags are entirely unsupported
by the underlying perl HTML Parser. To resolve this problem a sprint was done whereby a type of "relaxed" parsing
is enabled within the underlying Parser which disables specification conformance within any parsed documents.

This not only will allow HTML5 documents to be handled (although not in a specification conformant way) but also
will allow "in the wild" type documents to be handled as well.

To add the above feature HTML::TreeBuilder had to be overridden locally within the project. Any handles to
HTML::TreeBuilder are upgraded to our own internal TreeBuilder.

Additionally while here it was discovered that indentation was broken for all resulting HTML. This was corrected
for all HTML except those handled by relaxed mode. Relaxed parsing may or may not return properly indented html,
depending on whether or not it's entirely built of valid tags or not.

Finally a number of tests were updated, and the MANIFEST file was updated to be accurate again.
MM-8867

<forgot to commit it all in the last commit>

While performing some inlining of some various websites we discovered that HTML5 tags are entirely unsupported
by the underlying perl HTML Parser. To resolve this problem a sprint was done whereby a type of "relaxed" parsing
is enabled within the underlying Parser which disables specification conformance within any parsed documents.

This not only will allow HTML5 documents to be handled (although not in a specification conformant way) but also
will allow "in the wild" type documents to be handled as well.

To add the above feature HTML::TreeBuilder had to be overridden locally within the project. Any handles to
HTML::TreeBuilder are upgraded to our own internal TreeBuilder.

Additionally while here it was discovered that indentation was broken for all resulting HTML. This was corrected
for all HTML except those handled by relaxed mode. Relaxed parsing may or may not return properly indented html,
depending on whether or not it's entirely built of valid tags or not.

Finally a number of tests were updated, and the MANIFEST file was updated to be accurate again.
MM-8867

Additional refinements to relaxed parsing mode

HTML::TreeBuilder at it's core is a container. If we want to only print the interior contents
(which in this case we do, because the container is known to be spurious) the only real option
is to hack the HTML::TreeBuilder instance and indicate that the element is an empty literal.

By doing so we suppress both a start and end tag, but are left with some goofy indenting which
we later can take care of manually when we produce the final "inlined" text.

This approach is hacky, but I can find no other possible way through which to implement the
necessary functionality to pull this off. This seems to be the only possible way through which
HTML5 and sloppy HTML documents can be parsed.

Noticed that acidtest.t was not actually doing anything, so I removed the secondary test there,
as there is a dedicated test for determining if relaxed mode is working.

Renamed crazytags to relaxed, as the feature now has a name.
MM-8867

update MANIFEST to represent renamed test file
MM-8867

Create proper getter/setter for CSS::Inliner::TreeBuilder "relaxed" parsing property

Add new method "_validate_html" to report back corrections that TreeBuilder is performing
to make a tree parseable:
* Runs by default, can be skipped over by enabling relaxed parsing. IE does *not* run when relaxed.
* Multiple html, head and body tags all will now generate an warning within the content warnings array.
* Find style tags within body content that are not going to be processed, generate a warning
* Refactor unexpected "link" tags within content, now generate a warning instead of die. RT84513

Convert spurious double quotes to single quotes throughout Inliner.pm

Fix up spacing within method calls throughout Inliner.pm

Remove spurious () within stacked method calls, they make the code harder to read in my opinion.
MM-8867

relocate the code for formatting the output from as_HTML into the CSS::Inliner::TreeBuilder
subclass

this is a more correct location for this code, and will let someone (me?) use the relaxed
mode of TreeBuilder for other things besides Inlining...
MM-8867

revert accidental commit here, there should be no flags configuring Inliner for
this most basic test
MM-8867

Additional refinements to relaxed mode, which now very tightly coupled with the
implicit_tags setting for TreeBuilder.

It's pretty difficult to handle all the permutations of these flags while also
handling an argument containing a treebuilder reference - it's not clear which
argument would actually take precedence. Rather than deal with that problem
I am simply disallowing it for now, so the use of the html_tree and relaxed
flags will now throw an error if used together.
MM-8697

Update CSS::Inliner::Parser to identify and skip over any embedded media queries

Add tests to ensure the facility is working.

Update MANIFEST to represent added tests
MM-8867

update readme to reflect changes to relaxed mode
MM-8867

this script for testing a fetch needs to leave styles where they are so that
we can make sure relaxed mode is working right
MM-8867

The regex that was used to protect "declarations" was nowhere near specific enough -
turned out it was matching the IE if/endif declarations too - which were being handled
correctly previously, but now were broken.

Investigated further and it appears that there was special considering for doctype
within HTML::TreeBuilder, so we only specifically look to undo that particular work, as
no other tags seemingly got this kind of special treatment.
MM-8867

shift this line of code - it makes more sense to configure the TreeBuilder object
once in the constructor than repeatedly setting it every read
MM-8867

The previous technique of removing the spurious wrapping HTML tags within
the relaxed content output failed - in the event that you had trailing content
outside the html area it would strip that content too, and not comply with the
new "leave as much alone as possible" philosophy I am trying to implement.

Reverted back to converting the wrapping HTML block to a wrapping literal element
which is a little hacky, but a lot closer to generating a "legit" result. There
is still some stripping of whitespace that has to be done, but it's relatively
straightforward.

Given the way that TreeBuilder is implemented there is a risk here that the
literal tag could be made more strict, and thus break what I have here, but I think
that risk is small given how stable this specific code has been within TreeBuilder.
MM-8867

Rework the POD documentation to use consistent formatting throughout

Remove line of code that was stripping out the wrapping html tags around
a document - I cannot recall why I added this, but it does not appear to
be serving a useful purpose

Add additional code comments

When retrieving a remote document ("fetching") use relaxed parsing
to perform the initial parse - it is far less destructive than the base
TreeBuilder which was used before

Relax the identification queries for finding style/link tags within
the document(s). Previously we required the standard "text/css" type
to be present for style tags, and we required the standard rel
"stylesheet" and type "text/css" for link tags. Updated such that finding
these tags is good enough to try to inline them.

Update the validator method such that the expected counts for wrapping
html nodes reflects the recent change to TreeBuilder, it's a bit more
intuitive now.
MM-8867

POD is breaking for this first item, apparently the word "new" has some special significance
and causes the whitespacing to break... annoying
MM-8867

Regenerate README using the POD whitespace fix
MM-8867

fix bug whereby the less strict use of link tags was accidentally allowing non-css
to be inlined

appears some type of requirement for link tag attributes still needs to exist, but
requiring only 1 thing, instead of all of them should get better results for most
people
MM-8867

snapshot release for addition to CPAN and GitHub, tag files with new version number.

Version calculated by

Initial commits + total current commits + 1

3764 + 167 + 1 = 3932
MM-8867

fix Changelog formatting
update minimum expected treebuilder to 5.03 - apparently 4.2 doesn't exist anymore?
tick up internal version number